921 lines
27 KiB
HTML
921 lines
27 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">
|
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
|
<title>Syntax Check SQL Statement (QSQCHKS) API</title>
|
|
<!-- Begin Header Records ========================================== -->
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!-- File SCRIPT A converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
|
<!-- Change History: -->
|
|
<!-- YYMMDD USERID Change description -->
|
|
<!--File Edited March 2001 -->
|
|
<!-- This file has undergone html cleanup on 1/8/02 by JET -->
|
|
<!-- 041203 CLH Changed maximum SQL stmt length for API to 65535 -->
|
|
<!-- 050524 whitneyg Added *RPGLEFREE value for language parm -->
|
|
<!-- 050810 whitneyg Updated target release info -->
|
|
<!--End Header Records -->
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body>
|
|
<a name="top_Of_Page"></a>
|
|
<!-- Java sync-link -->
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
|
</script>
|
|
|
|
<h2>Syntax Check SQL Statement (QSQCHKS) API</h2>
|
|
|
|
<div class="box" style="width: 80%;">
|
|
<br>
|
|
Required Parameter Group:<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
<table width="100%">
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">1</td>
|
|
<td align="left" valign="top" width="50%">Source records containing SQL
|
|
statement</td>
|
|
<td align="left" valign="top" width="20%">Input</td>
|
|
<td align="left" valign="top" width="20%">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">2</td>
|
|
<td align="left" valign="top">Record length</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">3</td>
|
|
<td align="left" valign="top">Number of records provided</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">4</td>
|
|
<td align="left" valign="top">Language</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Char(10)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">5</td>
|
|
<td align="left" valign="top">Options</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">6</td>
|
|
<td align="left" valign="top">Statement information</td>
|
|
<td align="left" valign="top">Output</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">7</td>
|
|
<td align="left" valign="top">Length of statement information</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">8</td>
|
|
<td align="left" valign="top">Number of records processed</td>
|
|
<td align="left" valign="top">Output</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">9</td>
|
|
<td align="left" valign="top">Error code</td>
|
|
<td align="left" valign="top">I/O</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Yes<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The Syntax Check SQL Statements (QSQCHKS) API calls the DB2 UDB for iSeries
|
|
SQL parser to check the syntax of an SQL statement. If a specific language is
|
|
specified, the parser will scan the source records passed according to the
|
|
rules of the language. If a language is not passed, the parser will scan an SQL
|
|
statement using the Interactive SQL syntax rules.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Authorities and Locks</h3>
|
|
|
|
<p>No additional authority is required and no locks are acquired.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Required Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>Source records containing SQL statement</strong></dt>
|
|
|
|
<dd>INPUT; CHAR(*)
|
|
|
|
<p>The SQL statement that is to be parsed. This parameter can be passed as
|
|
source text records for an HLL or as an SQL statement.</p>
|
|
|
|
<p>If the statement is contained in source text records for an HLL, the SQL
|
|
statements must be in the form required by the precompiler for the specified
|
|
language. For example, in COBOL, the statements must be preceded by EXEC SQL
|
|
and followed by END-EXEC. Multiple statements will be processed. All the
|
|
records will be processed as long as enough storage is provided for the
|
|
statement information.</p>
|
|
|
|
<p>If a language is not specified, a single SQL statement must be passed
|
|
without any additional delimiters (such as EXEC SQL or ;).</p>
|
|
</dd>
|
|
|
|
<dt><strong>Record length</strong></dt>
|
|
|
|
<dd>INPUT; BINARY(4)
|
|
|
|
<p>The length of each record or the length of the SQL statement if language is
|
|
*NONE. If language is *NONE the length must be between 1 and 65535. Record
|
|
length for other languages must be at least as long as the right margin and
|
|
cannot be longer than 100.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Number of records provided</strong></dt>
|
|
|
|
<dd>INPUT; BINARY(4)
|
|
|
|
<p>The number of source records to scan for the statement. This must be 1 if
|
|
*NONE is specified for the language. If a language is specified, the number of
|
|
records must be between 1 and 65535.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Language</strong></dt>
|
|
|
|
<dd>INPUT; CHAR(10)
|
|
|
|
<p>The programming language for which the syntax check is to be performed.
|
|
Valid values include the following:</p>
|
|
|
|
|
|
<table cellpadding="5">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<td width="10%" valign="top"><img src="delta.gif" alt="Start of change"><em>*NONE</em></td>
|
|
<td width="90%" valign="top">A syntax check is performed on the SQL statement
|
|
using the Interactive SQL language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*CBL</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the
|
|
COBOL language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*FTN</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the
|
|
FORTRAN language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*PLI</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the
|
|
PL/I language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*RPG</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the RPG
|
|
language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*CLE</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the ILE
|
|
C language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*CBLLE</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the ILE
|
|
COBOL language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*RPGLE</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the
|
|
fixed-form ILE RPG language syntax rules.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*RPGLEFREE</em></td>
|
|
<td valign="top">A syntax check is performed on the SQL statement using the
|
|
free-form ILE RPG language syntax rules.<img src="deltaend.gif" alt="End of change"></td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>Options</strong></dt>
|
|
|
|
<dd>INPUT; CHAR(*)
|
|
|
|
<p>The options required by SQL to parse the statement. The options must be
|
|
specified as keys. The first part of the template is the number of keys passed,
|
|
followed by variable length records for each option specified. For a
|
|
description of the option data and keys, see <a href="#HDROPTPARM">Format for
|
|
Options</a>.</p>
|
|
|
|
<table cellpadding="5">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<td width="25%" valign="top"><em>Number of options specified</em></td>
|
|
<td width="75%" valign="top">BINARY(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"></td>
|
|
<td valign="top">Total number of all the options (keys) specified. If this is
|
|
0, then defaults are used for the options.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>Variable length option data</em></td>
|
|
<td valign="top">Variable length records containing the key indicating what key
|
|
is passed, followed by the length of the data and the data.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>Statement information</strong></dt>
|
|
|
|
<dd>OUTPUT; CHAR(*)
|
|
|
|
<p>The structure in which to return statement information for all statements
|
|
processed. For the format of the structure, see <a href="#HDRSTATINF">Statement
|
|
Information</a>.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Length of area for statement information</strong></dt>
|
|
|
|
<dd>Input; BINARY(4)
|
|
|
|
<p>The length of the area in which to return statement information. This length
|
|
must be at least 68 for information to be returned for statement. If a syntax
|
|
error occurs, the length must be long enough to also contain the replacement
|
|
text for the message. If more than 1 statement is processed, each statement
|
|
after the first requires 44 bytes plus the length of the replacement text for
|
|
any syntax errors.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Number of records processed</strong></dt>
|
|
|
|
<dd>Output; BINARY(4)
|
|
|
|
<p>The number of records processed. If the number of records processed is less
|
|
than the number of records provided, the either an error occurred or there was
|
|
not enough room in the statement information area to continue. This would never
|
|
be greater than the number of records provided.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Error code</strong></dt>
|
|
|
|
<dd>I/O; CHAR(*)
|
|
|
|
<p>The structure in which to return error information. For the format of the
|
|
structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
|
|
|
|
<h3><a name="HDROPTPARM">Format for Options</a></h3>
|
|
|
|
<p>The following table defines the format for the options.</p>
|
|
|
|
<table border width="80%">
|
|
<tr>
|
|
<th align="center" valign="bottom" colspan="2">Offset</th>
|
|
<th align="left" valign="bottom" rowspan="2">Type</th>
|
|
<th align="left" valign="bottom" rowspan="2">Field</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th align="center" valign="bottom">Dec</th>
|
|
<th align="center" valign="bottom">Hex</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="left" valign="top" width="20%">BINARY(4)</td>
|
|
<td align="left" valign="top" width="60%">Number of keys</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">0</td>
|
|
<td align="center" valign="top">0</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Key</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">04</td>
|
|
<td align="center" valign="top">04</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Length of data</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">08</td>
|
|
<td align="center" valign="top">08</td>
|
|
<td align="left" valign="top">CHAR(*)</td>
|
|
<td align="left" valign="top">Data</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p>If the length of character data is longer than the key field's data length,
|
|
the data will be truncated at the right. No message will be issued.</p>
|
|
|
|
<p>If the length of character data is smaller than the key field's data length,
|
|
the data will be padded with blanks at the right. No message will be
|
|
issued.</p>
|
|
|
|
<p>If the same key is specified more than once, the last value for the option
|
|
is used.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Field Descriptions</h3>
|
|
|
|
<p><strong>Data.</strong> The option used by SQL to scan the source and syntax
|
|
check the SQL statement.</p>
|
|
|
|
<p><strong>Key.</strong> Identifies a field of the options parameters. See <a
|
|
href="#HDRKEYS">Keys</a> for the list of valid keys.</p>
|
|
|
|
<p><strong>Length of data.</strong> The length of the data specified for the
|
|
option.</p>
|
|
|
|
<p><strong>Number of keys.</strong> The number of keys passed. This specifies
|
|
the number of key arrays following this field. The arrays contain the key,
|
|
length of data, and the data.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3><a name="HDRKEYS">Keys</a></h3>
|
|
|
|
<p>The following table lists the valid keys and the corresponding option.</p>
|
|
|
|
<table border width="80%">
|
|
<tr>
|
|
<th align="center" valign="top">Key</th>
|
|
<th align="left" valign="top">Type</th>
|
|
<th align="left" valign="top">Field</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">1</td>
|
|
<td align="left" valign="top" width="20%">CHAR(10)</td>
|
|
<td align="left" valign="top" width="70%">Naming convention</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">2</td>
|
|
<td align="left" valign="top">CHAR(1)</td>
|
|
<td align="left" valign="top">Operation</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">3</td>
|
|
<td align="left" valign="top">CHAR(1)</td>
|
|
<td align="left" valign="top">Character for delimited host strings</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">4</td>
|
|
<td align="left" valign="top">CHAR(1)</td>
|
|
<td align="left" valign="top">Character for delimited SQL strings</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">5</td>
|
|
<td align="left" valign="top">CHAR(1)</td>
|
|
<td align="left" valign="top">Character for the decimal point</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">6</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">left margin</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">7</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">right margin</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">8</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">CCSID</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">9</td>
|
|
<td align="left" valign="top">CHAR(10)</td>
|
|
<td align="left" valign="top">Target release</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Field Descriptions</h3>
|
|
|
|
<p><strong>CCSID.</strong> The CCSID to use for the source. The CCSID must be a
|
|
valid CCSID. If not specified, the job CCSID will be used.</p>
|
|
|
|
<p><strong>Character for delimited host strings.</strong> The character that is
|
|
to be used to delimit host character strings. This parameter is not valid if
|
|
the language is C or *NONE, and must be apostrophe if specified for FORTRAN,
|
|
PL/I and RPG. If not specified for COBOL, the default is the quotation mark.
|
|
Valid values include the following:</p>
|
|
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="5%" valign="top"><em>(')</em></td>
|
|
<td width="95%" valign="top">apostrophe</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>(")</em></td>
|
|
<td valign="top">quotation mark</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p><strong>Character for delimited SQL strings.</strong> The character that is
|
|
to be used to delimit character constants within an SQL statement. If the
|
|
language is COBOL, either values can be specified and the default is quotation
|
|
mark. If *NONE is specified for the language, either values can be specified
|
|
and the default is apostrophe. For other languages, only the apostrophe can be
|
|
specified. Valid values include the following:</p>
|
|
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="5%" valign="top"><em>(')</em></td>
|
|
<td width="95%" valign="top">apostrophe</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>(")</em></td>
|
|
<td valign="top">quotation mark</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p><strong>Character for the decimal point.</strong> The character that is to
|
|
be used for the decimal point. This parameter is valid for all languages. If
|
|
not specified, the system value (QDECFMT) will be used. Valid values include
|
|
the following:</p>
|
|
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="5%" valign="top"><em>(.)</em></td>
|
|
<td width="95%" valign="top">period</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>(,)</em></td>
|
|
<td valign="top">comma</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p><strong>Left margin.</strong> The left margin for the source. This parameter
|
|
is only valid if language is PL/I or C and the valid values are from 1 to 80.
|
|
If not specified, the default for PL/I is 2 and the default for C is 1. The
|
|
left margin for RPG, COBOL, and FORTRAN is defined by the language and cannot
|
|
be modified.</p>
|
|
|
|
<p><strong>Naming convention.</strong> The naming convention used to qualify
|
|
table names in the SQL statement. If this parameter is not passed, the default
|
|
is *NONE. Valid values include the following:</p>
|
|
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="10%" valign="top"><em>*NONE</em></td>
|
|
<td width="90%" valign="top">The naming convention is not known. Errors in the
|
|
qualification of table names are not returned.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*SYS</em></td>
|
|
<td valign="top">Table names are qualified using the system naming convention
|
|
in the form library/table.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>*SQL</em></td>
|
|
<td valign="top">Table names are qualified in the SQL naming convention in the
|
|
form library.table.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p><strong>Operation.</strong> The operation indicates what operations are to
|
|
be performed by SQL. For performance, work areas can be reused across calls to
|
|
the syntax checker, but SQL must be called eventually to terminate. The default
|
|
is to syntax check the statement and terminate (2). However, for performance it
|
|
is recommended that operation 0 be used in most cases when more than 1 SQL
|
|
statement is to be checked. In this case, SQL must be called eventually to
|
|
terminate. Valid values include the following:</p>
|
|
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="5%" valign="top"><em>0</em></td>
|
|
<td width="95%" valign="top">Syntax check the statement and do not terminate.
|
|
If this is specified, SQL must be called again to indicate the syntax check is
|
|
complete.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>1</em></td>
|
|
<td valign="top">Syntax check is complete. This option must be used to inform
|
|
SQL to terminate when no more SQL statements need to be syntax checked.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top"><em>2</em></td>
|
|
<td valign="top">Syntax check the statement and terminate.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<p><strong>Right margin.</strong> The right margin for the source. This
|
|
parameter is only valid if language is PL/I or C and the valid values are from
|
|
1 to 80. The right margin must always be greater than the left margin. If not
|
|
specified, the default for both PL/I and C is 80. The right margin for RPG,
|
|
COBOL, and FORTRAN is defined by the language and cannot be modified.</p>
|
|
|
|
<img src="delta.gif" alt="Start of change">
|
|
<p><strong>Target release.</strong> The target release for which the statement
|
|
should be syntax checked. If the statement cannot be taken back to the release
|
|
specified, SQL7906 will be returned in the statement information. The default
|
|
is the current release. The format VxRxMx is used to specify the release,
|
|
where Vx is the version, Rx is the release, and Mx is the modification level.
|
|
For example, V5R3M0 is version 5, release 3, modification 0. </p>
|
|
<img src="deltaend.gif" alt="End of change">
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<h3><a name="HDRSTATINF">Statement Information</a></h3>
|
|
|
|
<table border width="80%">
|
|
<!-- cols="10 10 20 60" -->
|
|
<tr>
|
|
<th align="center" valign="bottom" colspan="2">Offset</th>
|
|
<th align="left" valign="bottom" rowspan="2">Type</th>
|
|
<th align="left" valign="bottom" rowspan="2">Field</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th align="center" valign="bottom">Dec</th>
|
|
<th align="center" valign="bottom">Hex</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top" colspan="4">Statement information header</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="left" valign="top" width="20%">CHAR(10)</td>
|
|
<td align="left" valign="top" width="60%">Message file name</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">10</td>
|
|
<td align="center" valign="top">0A</td>
|
|
<td align="left" valign="top">CHAR(10)</td>
|
|
<td align="left" valign="top">Message file library name</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">20</td>
|
|
<td align="center" valign="top">14</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Number of statements processed</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top" colspan="4">Statement information returned for
|
|
statements processed (repeated for each statement processed for HLL):</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="center" valign="top" width="10%">0</td>
|
|
<td align="left" valign="top" width="20%">BINARY(4)</td>
|
|
<td align="left" valign="top" width="60%">Length of information returned for
|
|
this statement</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">4</td>
|
|
<td align="center" valign="top">4</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Record number of first byte of statement</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">8</td>
|
|
<td align="center" valign="top">8</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Column number of first byte of statement</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">12</td>
|
|
<td align="center" valign="top">C</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Record number of last byte of statement</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">16</td>
|
|
<td align="center" valign="top">10</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Column number of last byte of statement</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">20</td>
|
|
<td align="center" valign="top">14</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Record number of the syntax error</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">24</td>
|
|
<td align="center" valign="top">18</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Column number of the syntax error</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">28</td>
|
|
<td align="center" valign="top">1C</td>
|
|
<td align="left" valign="top">CHAR(7)</td>
|
|
<td align="left" valign="top">SQL message ID</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">35</td>
|
|
<td align="center" valign="top">23</td>
|
|
<td align="left" valign="top">CHAR(5)</td>
|
|
<td align="left" valign="top">SQLSTATE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">40</td>
|
|
<td align="center" valign="top">28</td>
|
|
<td align="left" valign="top">BINARY(4)</td>
|
|
<td align="left" valign="top">Length of message replacement text</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">44</td>
|
|
<td align="center" valign="top">2C</td>
|
|
<td align="left" valign="top">CHAR(*)</td>
|
|
<td align="left" valign="top">Message replacement text</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<h3>Field Descriptions</h3>
|
|
|
|
<p><strong>Column number of first byte of statement.</strong> The column
|
|
containing the first byte of the beginning delimiter for the SQL statement.
|
|
This would be the EXEC SQL in COBOL. This is blank if language is *NONE.</p>
|
|
|
|
<p><strong>Column number of last byte of statement.</strong> The column
|
|
containing the last byte of the ending delimiter for the SQL statement. This
|
|
would be the END-EXEC in COBOL. If the record and column number of the first
|
|
byte of the statement is set and the record and column number of the last byte
|
|
of the statement is not, then we were processing a statement but did not find
|
|
the end. No more records would be processed. This is blank if language is
|
|
*NONE.</p>
|
|
|
|
<p><strong>Column number of the syntax error.</strong> The column containing
|
|
the syntax error if one was found.</p>
|
|
|
|
<p><strong>Length of information returned for this statement.</strong> The
|
|
length of the information returned for a single statement. This can be used as
|
|
a displacement to the next statement.</p>
|
|
|
|
<p><strong>Length of message replacement text.</strong> The length of the
|
|
replacement text associated with the SQL message ID. If this is 0, then there
|
|
is no replacement text for the message.</p>
|
|
|
|
<p><strong>Message file library name.</strong> The library containing the SQL
|
|
message file.</p>
|
|
|
|
<p><strong>Message file name.</strong> The SQL Message file containing the
|
|
message for the syntax error returned.</p>
|
|
|
|
<p><strong>Message replacement text.</strong> A The replacement text for the
|
|
message.</p>
|
|
|
|
<p><strong>Number of statements processed.</strong> The number of statements
|
|
processed. If called with language *NONE, this would always be 1 if enough
|
|
space was provided for the statement information area.</p>
|
|
|
|
<p><strong>Record number of first byte of statement.</strong> The record
|
|
containing the first byte beginning delimiter for the SQL statement. This would
|
|
be the EXEC SQL in COBOL. This is blank if language is *NONE.</p>
|
|
|
|
<p><strong>Record number of last byte of statement.</strong> The record
|
|
containing the last byte of the ending delimiter for the SQL statement. This
|
|
would be the END-EXEC in COBOL. This is blank if language is *NONE.</p>
|
|
|
|
<p><strong>Record number of the syntax error.</strong> The record containing
|
|
the syntax error if one was found. If this is 0, then no error was found. If an
|
|
error is found when language is *NONE, this value would be 1.</p>
|
|
|
|
<p><strong>SQL message ID.</strong> If an error or warning is found, the
|
|
message ID is set to th name of the message corresponding to the syntax error
|
|
that occurred.</p>
|
|
|
|
<p><strong>SQLSTATE.</strong> The SQLSTATE is additional information
|
|
corresponding to the SQL return code. The SQLSTATEs are common across IBM SQL
|
|
products for errors. For detailed information on this, see the <a href=
|
|
"../sqlp/rbafykickoff.htm">DB2 UDB for SQL Programming Concepts</a> topic.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Error Messages</h3>
|
|
|
|
<table width="100%" cellpadding="3">
|
|
<tr>
|
|
<th align="left" valign="top">Message ID</th>
|
|
<th align="left" valign="top">Error Message Text</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="15%" valign="top">CPF24B4 E</td>
|
|
<td width="85%" valign="top">Severe error while addressing parameter list.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">CPF3C90 E</td>
|
|
<td valign="top">Literal value cannot be changed.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">CPF3CF1 E</td>
|
|
<td valign="top">Error code parameter not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL0901 E</td>
|
|
<td valign="top">Record length parameter not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5502 E</td>
|
|
<td valign="top">Number of source records not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5503 E</td>
|
|
<td valign="top">Character for delimited host string not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5504 E</td>
|
|
<td valign="top">Character for delimited SQL string not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5505 E</td>
|
|
<td valign="top">Language not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5506 E</td>
|
|
<td valign="top">Naming convention not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5507 E</td>
|
|
<td valign="top">Margins not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5508 E</td>
|
|
<td valign="top">CCSID not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5509 E</td>
|
|
<td valign="top">Character specified as decimal point not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5510 E</td>
|
|
<td valign="top">Option parameter not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5511 E</td>
|
|
<td valign="top">Key field &1 not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5512 E</td>
|
|
<td valign="top">Number of keys not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5513 E</td>
|
|
<td valign="top">Target release not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5514 E</td>
|
|
<td valign="top">Length of data for key &1 not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top">SQL5515 E</td>
|
|
<td valign="top">Length of area for statement information not valid.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<hr>
|
|
API introduced: V3R1
|
|
|
|
<hr>
|
|
<center>
|
|
<table cellpadding="2" cellspacing="2">
|
|
<tr align="center">
|
|
<td valign="middle" align="center"><a href="#top_Of_Page">Top</a> | <a href=
|
|
"file1.htm">Database and File APIs</a> | <a href="aplist.htm">APIs by
|
|
category</a></td>
|
|
</tr>
|
|
</table>
|
|
</center>
|
|
|
|
<br>
|
|
</body>
|
|
</html>
|
|
|