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

381 lines
14 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Create SQL Package (CRTSQLPKG)</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="CRTSQLPKG.Top_Of_Page"></a>
<h2>Create SQL Package (CRTSQLPKG)</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="#CRTSQLPKG.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CRTSQLPKG.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CRTSQLPKG.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CRTSQLPKG"></a>
<p>The Create Structured Query Language Package (CRTSQLPKG) command allows you to create (or re-create) an SQL package on a relational database from an existing distributed SQL program. A distributed SQL program is a program created by specifying the <b>Relational database (RDB)</b> parameter on a CRTSQLxxx (where xxx = CBL, CBLI, CI, CPPI, PLI, RPG or RPGI) command.
</p>
<p>More information is in the SQL Programming information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CRTSQLPKG.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="#CRTSQLPKG.PGM"><b>PGM</b></a></td>
<td valign="top">Program</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: Program</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="#CRTSQLPKG.RDB"><b>RDB</b></a></td>
<td valign="top">Relational database</td>
<td valign="top"><i>Simple name</i>, <b><u>*PGM</u></b></td>
<td valign="top">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.USER"><b>USER</b></a></td>
<td valign="top">RDB user</td>
<td valign="top"><i>Name</i>, <b><u>*CURRENT</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.PASSWORD"><b>PASSWORD</b></a></td>
<td valign="top">RDB user password</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b>, '&nbsp;'</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.DFTRDBCOL"><b>DFTRDBCOL</b></a></td>
<td valign="top">Default collection</td>
<td valign="top"><i>Name</i>, <b><u>*PGM</u></b>, *NONE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.OBJTYPE"><b>OBJTYPE</b></a></td>
<td valign="top">Object type</td>
<td valign="top"><b><u>*PGM</u></b>, *SRVPGM</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.MODULE"><b>MODULE</b></a></td>
<td valign="top">Module list</td>
<td valign="top">Single values: <b><u>*ALL</u></b><br>Other values (up to 256 repetitions): <i>Name</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.TEXT"><b>TEXT</b></a></td>
<td valign="top">Text 'description'</td>
<td valign="top"><i>Character value</i>, <b><u>*PGMTXT</u></b>, *BLANK</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.GENLVL"><b>GENLVL</b></a></td>
<td valign="top">Severity level</td>
<td valign="top">0-40, <b><u>10</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTSQLPKG.REPLACE"><b>REPLACE</b></a></td>
<td valign="top">Replace</td>
<td valign="top"><b><u>*YES</u></b>, *NO</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CRTSQLPKG.PRTFILE"><b>PRTFILE</b></a></td>
<td valign="top">Print file</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Print file</td>
<td valign="top"><i>Name</i>, <b><u>QSYSPRT</u></b></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr></table>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CRTSQLPKG.PGM"></a>
<h3>Program (PGM)</h3>
<p>Specifies the name of the program for which the SQL package is being created. The program must be a distributed SQL program that was created using one of the CRTSQLxxx (where xxx = CBL, CBLI, CI, CPPI, PLI, RPG or RPGI) commands.
</p>
<p><b>Qualifier 1: Program</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the program for which the SQL package is to be created.
</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 used to locate the program. If no current library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library where the program is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.RDB"></a>
<h3>Relational database (RDB)</h3>
<p>Specifies the relational database where the SQL package is being created.
</p>
<dl>
<dt><b><u>*PGM</u></b></dt>
<dd>The relational database name specified for the <b>Relational database (RDB)</b> parameter of the CRTSQLxxx (where xxx = CBL, CBLI, CI, CPPI, PLI, RPG or RPGI) command that originally created the program is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the relational database where the SQL package is to be created. Use the Work with Relational Database Directory Entry (WRKRDBDIRE) command to show the relational database names that are valid for this parameter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.USER"></a>
<h3>RDB user (USER)</h3>
<p>Specifies the user name sent to the remote system when starting the conversation.
</p>
<dl>
<dt><b><u>*CURRENT</u></b></dt>
<dd>The user name associated with the current job is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the user name being used for the application requester job.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.PASSWORD"></a>
<h3>RDB user password (PASSWORD)</h3>
<p>Specifies the password to be used on the remote system.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No password is sent. The user name specified for the <b>RDB user (USER)</b> parameter is not valid if this value is specified.
</dd>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the password of the user name specified for the USER parameter. A password value of a blank is treated the same as specifying *NONE.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.DFTRDBCOL"></a>
<h3>Default collection (DFTRDBCOL)</h3>
<p>Specifies the schema name to be used for unqualified names of tables, views, indexes, SQL packages, aliases, constraints, external programs, node groups, and triggers. This parameter applies only to static SQL statements in the package.
</p>
<dl>
<dt><b><u>*PGM</u></b></dt>
<dd>The schema name specified for the <b>Default collection (DFTRDBCOL)</b> parameter of the CRTSQLxxx (where xxx = CBL, CBLI, CI, CPPI, PLI, RPG or RPGI) command used to create the program for which an SQL package is being created is used.
</dd>
<dt><b>*NONE</b></dt>
<dd>The <b>Naming convention</b> option specified for the <b>Precompiler options (OPTION)</b> parameter of the CRTSQLxxx (where xxx = CBL, CBLI, CI, CPPI, PLI, RPG or RPGI) command used to precompile the program is used to determine the schema name.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the schema name that is used for unqualified tables, views, indexes, SQL packages, aliases, constraints, external programs, node groups, and triggers.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.OBJTYPE"></a>
<h3>Object type (OBJTYPE)</h3>
<p>Specifies the type of program for which an SQL package is created.
</p>
<dl>
<dt><b><u>*PGM</u></b></dt>
<dd>Create an SQL package from the program specified for the <b>Program (PGM)</b> parameter.
</dd>
<dt><b>*SRVPGM</b></dt>
<dd>Create an SQL package from the service program specified for the PGM parameter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.MODULE"></a>
<h3>Module list (MODULE)</h3>
<p>Specifies a list of modules in a bound program.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*ALL</b></dt>
<dd>An SQL package is created for all modules in the program. An error message is sent if none of the modules in the program contain SQL statements or none of the modules is a distributed program.
</dd>
</dl>
<p><b>Other values (up to 256 repetitions)</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the modules in the program for which an SQL package is to be created. If more than 256 modules exist that need to be packaged, multiple CRTSQLPKG commands must be used. A maximum of 1024 modules can be in a program that has at least one module containing an SQL statement.
<p>Duplicate module names in the same program are allowed. This command looks at each module in the program and if *ALL or the module name is specified for the MODULE parameter, processing continues to determine whether an SQL package should be created. If the module is created using SQL and the <b>Relational database (RDB)</b> parameter is specified on the precompile command, an SQL package is created for the module. The SQL package is associated with the module of the bound program.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.TEXT"></a>
<h3>Text 'description' (TEXT)</h3>
<p>Specifies text that briefly describes the SQL package and its function.
</p>
<dl>
<dt><b><u>*PGMTXT</u></b></dt>
<dd>The text from the program for which the SQL package is being created is used.
</dd>
<dt><b>*BLANK</b></dt>
<dd>No text is specified.
</dd>
<dt><b><i>'description'</i></b></dt>
<dd>Specify no more than 50 characters of text, enclosed in apostrophes.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.GENLVL"></a>
<h3>Severity level (GENLVL)</h3>
<p>Specifies the maximum severity level allowed for errors detected during SQL package creation. If errors occur at a level that exceeds the level you specify, the SQL package is not created.
</p>
<dl>
<dt><b><u>10</u></b></dt>
<dd>The maximum severity level is 10.
</dd>
<dt><b><i>0-40</i></b></dt>
<dd>Specify the maximum severity level.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.REPLACE"></a>
<h3>Replace (REPLACE)</h3>
<p>Specifies whether an existing SQL package of the same name in the specified library is replaced by the new SQL package.
</p>
<dl>
<dt><b><u>*YES</u></b></dt>
<dd>An existing SQL package of the same name is replaced by the new SQL package.
</dd>
<dt><b>*NO</b></dt>
<dd>An existing SQL package of the same name is not replaced; a new SQL package is not created if the package already exists.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTSQLPKG.PRTFILE"></a>
<h3>Print file (PRTFILE)</h3>
<p>Specifies the printer device file to which the create SQL package error listing is directed. If no errors are detected during the creation of the SQL package, no listing is produced.
</p>
<p><b>Qualifier 1: Print file</b>
</p>
<dl>
<dt><b><u>QSYSPRT</u></b></dt>
<dd>The create SQL package error listing is directed to the IBM-supplied printer file, QSYSPRT.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the printer device file to which the create SQL package error listing is directed.
</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 used to locate the printer file. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library where the printer file is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTSQLPKG.COMMAND.EXAMPLES">Examples</a> </h3>
<p>
<pre>
CRTSQLPKG PGM(PAYROLL) RDB(SYSTEMA) TEXT('Payroll Program')
</pre>
</p>
<p>This command creates an SQL package from the distributed SQL program PAYROLL on relational database SYSTEMA.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTSQLPKG.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>SQL9004</b></dt>
<dd>Create of SQL package failed.
</dd>
<dt><b>SQL9006</b></dt>
<dd>DB2 UDB Query Manager and SQL Development Kit for iSeries not at same install level as i5/OS.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTSQLPKG.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>