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

153 lines
5.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>Print SQL Information (PRTSQLINF)</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="PRTSQLINF.Top_Of_Page"></a>
<h2>Print SQL Information (PRTSQLINF)</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="#PRTSQLINF.PARAMETERS.TABLE">Parameters</a><br>
<a href="#PRTSQLINF.COMMAND.EXAMPLES">Examples</a><br>
<a href="#PRTSQLINF.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="PRTSQLINF"></a>
<p>The Print Structured Query Language Information (PRTSQLINF) command allows you to print information about the SQL statements in a program, SQL package, service program, or job. The information includes the SQL statements, the access plans used during the running of the statement, and a list of the command parameters which are defined either during the precompile of the source member for the object or when SQL statements are run.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="PRTSQLINF.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="#PRTSQLINF.OBJ"><b>OBJ</b></a></td>
<td valign="top">Object</td>
<td valign="top">Single values: *JOB<br>Other values: <i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Object</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="#PRTSQLINF.OBJTYPE"><b>OBJTYPE</b></a></td>
<td valign="top">Object type</td>
<td valign="top"><b><u>*PGM</u></b>, *SQLPKG, *SRVPGM</td>
<td valign="top">Optional, Positional 2</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="PRTSQLINF.OBJ"></a>
<h3>Object (OBJ)</h3>
<p>Specifies either the name of the object for which you want SQL information printed or *JOB indicating that the job's SQL information is to be printed. A named object can be a program, an SQL package, or a service program.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*JOB</b></dt>
<dd>The SQL information for the current job is to be printed. The output will only contain information for statements which have been dynamically prepared for the job. It will not contain information for SQL statements in programs, service programs, or SQL packages used by the job.
</dd>
</dl>
<p><b>Qualifier 1: Object</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the program or SQL package for which you want information printed.
</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="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="PRTSQLINF.OBJTYPE"></a>
<h3>Object type (OBJTYPE)</h3>
<p>Specifies the object type of the object specified for the <b>Object (OBJ)</b> parameter.
</p>
<dl>
<dt><b><u>*PGM</u></b></dt>
<dd>The object is a program.
</dd>
<dt><b>*SQLPKG</b></dt>
<dd>The object is an SQL package.
</dd>
<dt><b>*SRVPGM</b></dt>
<dd>The object is a service program.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="PRTSQLINF.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Printing SQL Information</b>
</p>
<p>
<pre>
PRTSQLINF PAYROLL
</pre>
</p>
<p>This command will print information about the SQL statements contained in program PAYROLL.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="PRTSQLINF.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>SQL9011</b></dt>
<dd>Print of SQL information failed.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#PRTSQLINF.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>