On 03 Sep 2013 14:53, Hoteltravelfundotcom wrote:
I have a VIEW but was written now some weeks back. I would like to
see the actual code that created this view.
The definition of the VIEW, the CREATE statement, is stored in the
*FILE object. That information is available from the DSPFD command, the
Retrieve Database File Description (QDBRTVFD) API, and the Generate Data
Definition Language (QSQGNDDL) API. That statement is also reflected in
the *DBXREF data, so that same information can come from the SQL Catalog
as well; e.g. SYSVIEWS. Any interface that exposes that information
from either the file object or the catalogs, can provide the information
in various other forms; e.g. iNav Database.
If I look back in STRSQL, how can I be assured that I am looking at
the latest one?
Normally the statement would be the last chronologically ordered
successful CREATE that was not later rolled back; saving the session to
a source file and then scanning the source with a /find/ feature is
easier IMO than trying to scroll through the interactive session log.
However that method presumes that the correct\only session of yours was
being reviewed, additionally that it was your session that issued the
CREATE versus the session of someone else, and that the CREATE was not
performed via an entirely different interface [yet if created from
RUNSQLSTM, the source member and source date\time should be recorded in
the object OIR].
As others have suggested, getting the definition from the current
object [or from the catalogs which should reflect the current object] is