Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Retrieve Query Management Query (RTVQMQRY) command allows you to retrieve Structured Query Language (SQL) source from a query management query (QMQRY) object. The source records are placed into an editable source file member.
You can also retrieve query source from a query definition (QRYDFN) object when the specified QMQRY does not exist.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
QMQRY | Query management query | Qualified object name | Required, Positional 1 |
Qualifier 1: Query management query | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRCFILE | Source file | Qualified object name | Required, Positional 2 |
Qualifier 1: Source file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRCMBR | Source member | Name, *QMQRY | Optional, Positional 3 |
ALWQRYDFN | Allow information from QRYDFN | *NO, *YES, *ONLY | Optional |
Top |
Specifies the query management query whose source is to be retrieved.
This is a required parameter.
Qualifier 1: Query management query
Qualifier 2: Library
Top |
Specifies the previously-created source physical file into which the query source records are to be written.
This is a required parameter.
Qualifier 1: Source file
Qualifier 2: Library
Top |
Specifies the source file member into which the query source records are being written. If the member existed before running this command, it is cleared before any source records are written to it. If the member does not exist, it is created.
Top |
Specifies whether query information is taken from a query definition (QRYDFN) object when a query management (QMQRY) object cannot be found using the specified object name. Any information that has to be derived in this way is discarded when the command has completed processing. No query management object is created.
Top |
Example 1: Retrieving SQL Source
RTVQMQRY QMQRY(RPTLIB/SALQRY) SRCFILE(QRYS) SRCMBR(EMPQRY)
This command retrieves the source from the query named SALQRY located in the RPTLIB library. The source records that are retrieved are placed into the newly created or cleared member EMPQRY in the first file named QRYS in the user's library.
Example 2: Retrieving Source From Either the QMQRY or the QRYDFN
RTVQMQRY QMQRY(RPTLIB/SALQRY) SRCFILE(QRYS) SRCMBR(EMPQRY) ALWQRYDFN(*YES)
This command retrieves the source from the query management query (QMQRY) named SALQRY in the RPTLIB library. If there is no QMQRY object named SALQRY in the RPTLIB library, then the query source is retrieved from the query definition (QRYDFN) named SALQRY in the RPTLIB library. The source records are placed into the newly created or cleared member EMPQRY in the first file named QRYS in the user's library list.
Top |
*ESCAPE Messages
Top |