ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/rtvqmqry.htm

232 lines
8.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Retrieve Query Mgmt Query (RTVQMQRY)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="RTVQMQRY.Top_Of_Page"></a>
<h2>Retrieve Query Mgmt Query (RTVQMQRY)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#RTVQMQRY.PARAMETERS.TABLE">Parameters</a><br>
<a href="#RTVQMQRY.COMMAND.EXAMPLES">Examples</a><br>
<a href="#RTVQMQRY.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="RTVQMQRY"></a>
<p>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.
</p>
<p>You can also retrieve query source from a query definition (QRYDFN) object when the specified QMQRY does not exist.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="RTVQMQRY.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#RTVQMQRY.QMQRY"><b>QMQRY</b></a></td>
<td valign="top">Query management query</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Query management query</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top" rowspan="3"><a href="#RTVQMQRY.SRCFILE"><b>SRCFILE</b></a></td>
<td valign="top">Source file</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 2</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Source file</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top"><a href="#RTVQMQRY.SRCMBR"><b>SRCMBR</b></a></td>
<td valign="top">Source member</td>
<td valign="top"><i>Name</i>, <b><u>*QMQRY</u></b></td>
<td valign="top">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#RTVQMQRY.ALWQRYDFN"><b>ALWQRYDFN</b></a></td>
<td valign="top">Allow information from QRYDFN</td>
<td valign="top"><b><u>*NO</u></b>, *YES, *ONLY</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="RTVQMQRY.QMQRY"></a>
<h3>Query management query (QMQRY)</h3>
<p>Specifies the query management query whose source is to be retrieved.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Query management query</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the query whose source is to be retrieved.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RTVQMQRY.SRCFILE"></a>
<h3>Source file (SRCFILE)</h3>
<p>Specifies the previously-created source physical file into which the query source records are to be written.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Source file</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the source file to receive the query source being retrieved.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RTVQMQRY.SRCMBR"></a>
<h3>Source member (SRCMBR)</h3>
<p>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.
</p>
<dl>
<dt><b><u>*QMQRY</u></b></dt>
<dd>The member name is the same as the query name specified on the QMQRY parameter.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file member to receive the query source.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RTVQMQRY.ALWQRYDFN"></a>
<h3>Allow information from QRYDFN (ALWQRYDFN)</h3>
<p>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.
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>Information is not taken from a QRYDFN object.
</dd>
<dt><b>*YES</b></dt>
<dd>Information is taken from a QRYDFN object when the specified QMQRY object is not found.
</dd>
<dt><b>*ONLY</b></dt>
<dd>Information is taken only from a QRYDFN object. Query management objects are ignored.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RTVQMQRY.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Retrieving SQL Source</b>
</p>
<p>
<pre>
RTVQMQRY QMQRY(RPTLIB/SALQRY) SRCFILE(QRYS) SRCMBR(EMPQRY)
</pre>
</p>
<p>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.
</p>
<p><b>Example 2: Retrieving Source From Either the QMQRY or the QRYDFN</b>
</p>
<p>
<pre>
RTVQMQRY QMQRY(RPTLIB/SALQRY) SRCFILE(QRYS) SRCMBR(EMPQRY)
ALWQRYDFN(*YES)
</pre>
</p>
<p>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.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RTVQMQRY.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>QWM2701</b></dt>
<dd>&amp;1 command failed.
</dd>
<dt><b>QWM2703</b></dt>
<dd>&amp;1 command ended.
</dd>
<dt><b>QWM2705</b></dt>
<dd>Source file &amp;1 in &amp;2 not available.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RTVQMQRY.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>