ibm-information-center/dist/eclipse/plugins/i5OS.ic.cli_5.4.0.1/rzadpfnprcco.htm

454 lines
28 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="SQLProcedureColumns - Get input/output parameter information for a procedure" />
<meta name="DC.Relation" scheme="URI" content="rzadphdapi.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzadpfnprcco" />
<meta name="DC.Language" content="en-us" />
<!-- 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>SQLProcedureColumns</title>
</head>
<body id="rzadpfnprcco"><a name="rzadpfnprcco"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLProcedureColumns - Get input/output parameter information for a
procedure</h1>
<div><div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLProcedureColumns()</samp> returns
a list of input and output parameters associated with a procedure. The information
is returned in an SQL result set, which can be retrieved using the same functions
that are used to process a result set that is generated by a query.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLProcedureColumns(SQLHSTMT StatementHandle,
SQLCHAR *CatalogName,
SQLSMALLINT NameLength1,
SQLCHAR *SchemaName,
SQLSMALLINT NameLength2,
SQLCHAR *ProcName,
SQLSMALLINT NameLength3,
SQLCHAR *ColumnName,
SQLSMALLINT NameLength4);</pre>
</div>
<div class="section"><h4 class="sectiontitle">Function arguments</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="all"><caption>Table 1. SQLProcedureColumns arguments</caption><thead align="left"><tr><th align="left" valign="bottom" width="25.04708097928437%" id="d0e47">Data type</th>
<th align="left" valign="bottom" width="21.657250470809792%" id="d0e49">Argument </th>
<th align="left" valign="bottom" width="10.16949152542373%" id="d0e51">Use </th>
<th align="left" valign="bottom" width="43.12617702448211%" id="d0e53">Description </th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLCHAR *</td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>CatalogName</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Catalog qualifier of a 3 part procedure name.
<p>This must be a NULL pointer or a zero length string.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLCHAR *</td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>ColumnName</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Buffer that might contain a <span class="synph"><span class="var">pattern-value</span></span> to
qualify the result set by parameter name. This argument is to be used to further
qualify the result set already restricted by specifying a non-empty value
for ProcName or SchemaName.</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLCHAR *</td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>ProcName</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Buffer that might contain a <span class="synph"><span class="var">pattern-value</span></span> to
qualify the result set by procedure name.</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLCHAR *</td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>SchemaName</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Buffer that might contain a <span class="synph"><span class="var">pattern-value</span></span> to
qualify the result set by schema name. <p>For DB2 Universal Database™ for z/OS<sup>®</sup> and OS/390<sup>®</sup> V
4.1, all the stored procedures are in one schema; the only acceptable value
for the <span class="synph"><span class="var">SchemaName</span></span> argument is a null pointer. For DB2
Universal Database™, <span class="synph"><span class="var">SchemaName</span></span> can contain
a valid pattern value.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLHSTMT </td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>StatementHandle </em></td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLSMALLINT </td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>NameLength1</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Length of <span class="synph"><span class="var">CatalogName</span></span>.
This must be set to 0.</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLSMALLINT </td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>NameLength2</em> </td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Length of <span class="synph"><span class="var">SchemaName</span>.</span></td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLSMALLINT </td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>NameLength3</em></td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Length of <em>ProcName</em>.</td>
</tr>
<tr><td align="left" valign="top" width="25.04708097928437%" headers="d0e47 ">SQLSMALLINT </td>
<td align="left" valign="top" width="21.657250470809792%" headers="d0e49 "><em>NameLength4</em></td>
<td align="left" valign="top" width="10.16949152542373%" headers="d0e51 ">Input </td>
<td align="left" valign="top" width="43.12617702448211%" headers="d0e53 ">Length of <span class="synph"><span class="var">ColumnName</span>.</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p>DB2<sup>®</sup> UDB CLI returns information about the
input, input and output, and output parameters associated with the stored
procedure, but cannot return information about the descriptor for any result
sets returned.</p>
<p><samp class="codeph">SQLProcedureColumns()</samp> returns the information
in a result set, ordered by PROCEDURE_CAT, PROCEDURE_SCHEM, PROCEDURE_NAME,
and COLUMN_TYPE. <a href="#rzadpfnprcco__pstcols">Table 2</a> lists the columns
in the result set. Applications should be aware that columns beyond the last
column might be defined in future releases.</p>
<p>Because calls to <samp class="codeph">SQLProcedureColumns()</samp> in
many cases map to a complex and thus expensive query against the system catalog,
they should be used sparingly, and the results saved rather than repeating
calls.</p>
<div class="tablenoborder"><a name="rzadpfnprcco__pstcols"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rzadpfnprcco__pstcols" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. Columns
returned by SQLProcedureColumns</caption><thead align="left"><tr><th align="left" valign="bottom" width="26.765799256505574%" id="d0e232">Column number/name</th>
<th align="left" valign="bottom" width="26.022304832713754%" id="d0e234">Data type</th>
<th align="left" valign="bottom" width="47.21189591078067%" id="d0e236">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">1  PROCEDURE_CAT </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(128) </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The current server.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">2  PROCEDURE_SCHEM </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(128) </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The name of the schema containing PROCEDURE_NAME.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">3  PROCEDURE_NAME </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(128) </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Name of the procedure.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">4  COLUMN_NAME </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(128) </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Name of the parameter.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">5  COLUMN_TYPE </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT not NULL</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Identifies the type information associated
with this row. The values can be: <ul><li>SQL_PARAM_TYPE_UNKNOWN the parameter type is unknown. <div class="note"><span class="notetitle">Note:</span> This is
not returned.</div>
</li>
<li>SQL_PARAM_INPUT this parameter is an input parameter.</li>
<li>SQL_PARAM_INPUT_OUTPUT this parameter is an input / output parameter.</li>
<li>SQL_PARAM_OUTPUT this parameter is an output parameter.</li>
<li>SQL_RETURN_VALUE the procedure column is the return value of the procedure.
<div class="p"> <div class="note"><span class="notetitle">Note:</span> This is not returned.</div>
</div>
</li>
<li>SQL_RESULT_COL this parameter is actually a column in the result set. <div class="p">
<div class="note"><span class="notetitle">Note:</span> This is not returned.</div>
</div>
</li>
</ul>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">6  DATA_TYPE </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT not NULL</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">SQL data type.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">7  TYPE_NAME</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(128) not NULL</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Character string representing the name of
the data type corresponding to DATA_TYPE.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">8  COLUMN_SIZE </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">INTEGER </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">If the DATA_TYPE column value denotes a character
or binary string, then this column contains the maximum length in bytes; if
it is a graphic (DBCS) string, this is the number of double byte characters
for the parameter. <p> For date, time, timestamp data types, this is the
total number of bytes required to display the value when converted to character.</p>
<p>
For numeric data types, this is either the total number of digits, or the
total number of bits allowed in the column, depending on the value in the
NUM_PREC_RADIX column in the result set.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">9  BUFFER_LENGTH</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">INTEGER </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The maximum number of bytes for the associated
C buffer to store data from this parameter if SQL_C_DEFAULT were specified
on the <samp class="codeph">SQLBindCol(), SQLGetData()</samp> and <samp class="codeph">SQLBindParameter()</samp> calls.
This length excludes any null-terminator. For exact numeric data types, the
length accounts for the decimal and the sign. </td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">10  DECIMAL_DIGITS</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The scale of the parameter. NULL is returned
for data types where scale is not applicable.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">11  NUM_PREC_RADIX </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Either 10 or 2 or NULL. If DATA_TYPE is an
approximate numeric data type, this column contains the value 2, then the
COLUMN_SIZE column contains the number of bits allowed in the parameter. <p>If
DATA_TYPE is an exact numeric data type, this column contains the value 10
and the COLUMN_SIZE and DECIMAL_DIGITS columns contain the number of decimal
digits allowed for the parameter.</p>
<p>For numeric data types, the Database
Management System (DBMS) can return a NUM_PREC_RADIX of either 10 or 2.</p>
<p>
NULL is returned for data types where radix is not applicable.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">12  NULLABLE </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(3)</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">'NO' if the parameter does not accept NULL
values. <p>'YES' if the parameter accepts NULL values.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">13  REMARKS </td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR(254) </td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Might contain descriptive information about
the parameter.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">14  COLUMN_DEF</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The default value of the column. <p>If NULL
is specified as the default value, then this column is the word NULL, not
enclosed in quotation marks. If the default value cannot be represented without
truncation, then this column contains TRUNCATED, with no enclosing single
quotation marks. If no default value is specified, then this column is NULL.</p>
<p>The
value of COLUMN_DEF can be used in generating a new column definition, except
when it contains the value TRUNCATED.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">15  SQL_DATA_TYPE</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT not NULL</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The value of the SQL data type as it appears
in the SQL_DESC_TYPE field of the descriptor. This column is the same as
the DATA_TYPE column except for datetime data types (DB2 UDB CLI does not support interval data
types). <p>For datetime data types, the SQL_DATA_TYPE field in the result
set is SQL_DATETIME, and the SQL_DATETIME_SUB field returns the subcode for
the specific datetime data type (SQL_CODE_DATE, SQL_CODE_TIME or SQL_CODE_TIMESTAMP).</p>
</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">16  SQL_DATETIME_SUB</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">SMALLINT</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The subtype code for datetime data types.
For all other data types this column returns a NULL (including interval data
types which DB2 UDB
CLI does not support).</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">17  CHAR_OCTET_LENGTH</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">INTEGER</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">The maximum length in bytes of a character
data type column. For all other data types, this column returns a NULL.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">18  ORDINAL_POSITION</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">INTEGER NOT NULL</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 ">Contains the ordinal position of the parameter
given by COLUMN_NAME in this result set. This is the ordinal position of the
argument to be provided on the CALL statement. The leftmost argument has an
ordinal position of 1.</td>
</tr>
<tr><td align="left" valign="top" width="26.765799256505574%" headers="d0e232 ">19  IS_NULLABLE</td>
<td align="left" valign="top" width="26.022304832713754%" headers="d0e234 ">VARCHAR</td>
<td align="left" valign="top" width="47.21189591078067%" headers="d0e236 "> <ul><li>“NO” if the column does not include NULLs.</li>
<li>“YES” if the column can include NULLs.</li>
<li>zero-length string if nullability is unknown.</li>
</ul>
ISO rules are followed to determine nullability. <p>An ISO SQL-compliant
DBMS cannot return an empty string.</p>
<p>The value returned for this column
is different than the value returned for the NULLABLE column. (See the description
of the NULLABLE column.)</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Return codes</h4><div class="p"> <ul><li>SQL_SUCCESS</li>
<li>SQL_SUCCESS_WITH_INFO</li>
<li>SQL_STILL_EXECUTING</li>
<li>SQL_ERROR</li>
<li>SQL_INVALID_HANDLE</li>
</ul>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error conditions</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 3. SQLProcedureColumns SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="bottom" width="12.962962962962962%" id="d0e474">SQLSTATE </th>
<th align="left" valign="bottom" width="29.074074074074076%" id="d0e476">Description </th>
<th align="left" valign="bottom" width="57.96296296296296%" id="d0e478">Explanation </th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>24</strong>000 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Cursor state that is not valid</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">A cursor is already opened on the statement
handle.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>40</strong>003 <strong>08</strong>S01</td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Communication link failure</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">The communication link between the application
and data source fails before the function is completed.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>42</strong>601 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">PARMLIST syntax error</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">The PARMLIST value in the stored procedures
catalog table contains a syntax error.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>001 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Memory allocation failure</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">DB2 UDB CLI is unable to allocate memory
required to support the processing or completion of the function.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>008</td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Operation canceled</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">&nbsp;</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>010 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Function sequence error</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">&nbsp;</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>014 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">No more handles</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">DB2 UDB CLI is unable to allocate a handle
due to internal resources.</td>
</tr>
<tr><td valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>021</td>
<td valign="top" width="29.074074074074076%" headers="d0e476 ">Internal descriptor that is not valid </td>
<td valign="top" width="57.96296296296296%" headers="d0e478 ">The internal descriptor cannot be addressed or allocated,
or it contains a value that is not valid.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>090 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">String or buffer length that is not valid</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">The value of one of the name length arguments
is less than 0, but not equal SQL_NTS.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>C00 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Driver not capable</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">DB2 UDB CLI does not support <span class="synph"><span class="var">catalog</span></span> as
a qualifier for procedure name. <p>The connected server does not support <span class="synph"><span class="var">schema</span></span> as
a qualifier for procedure name.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e474 "><strong>HY</strong>T00 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e476 ">Timeout expired</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e478 ">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Restrictions</h4><p><samp class="codeph">SQLProcedureColumns()</samp> does
not return information about the attributes of result sets that can be returned
from stored procedures.</p>
<p> If an application is connected to a DB2 server that
does not provide support for a stored procedure catalog, or does not provide
support for stored procedures, <samp class="codeph">SQLProcedureColumns()</samp> returns
an empty result set.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example</h4></div>
<div class="example" id="rzadpfnprcco__xmpcols"><a name="rzadpfnprcco__xmpcols"><!-- --></a><div class="p"><div class="note"><span class="notetitle">Note:</span> By using the code examples,
you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
<pre>/* From CLI sample proccols.c */
/* ... */
printf("Enter Procedure Schema Name Search Pattern:\n");
gets((char *)proc_schem.s);
printf("Enter Procedure Name Search Pattern:\n");
gets((char *)proc_name.s);
rc = SQLProcedureColumns(hstmt, NULL, 0, proc_schem.s, SQL_NTS,
proc_name.s, SQL_NTS, (SQLCHAR *)"%", SQL_NTS);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 2, SQL_C_CHAR, (SQLPOINTER) proc_schem.s, 129,
&amp;proc_schem.ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 3, SQL_C_CHAR, (SQLPOINTER) proc_name.s, 129,
&amp;proc_name.ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 4, SQL_C_CHAR, (SQLPOINTER) column_name.s, 129,
&amp;column_name.ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 5, SQL_C_SHORT, (SQLPOINTER) &amp;arg_type,
0, &amp;arg_type_ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 7, SQL_C_CHAR, (SQLPOINTER) type_name.s, 129,
&amp;type_name.ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 8, SQL_C_LONG, (SQLPOINTER) &amp; length,
0, &amp;length_ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 10, SQL_C_SHORT, (SQLPOINTER) &amp;scale,
0, &amp;scale_ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
rc = SQLBindCol(hstmt, 13, SQL_C_CHAR, (SQLPOINTER) remarks.s, 255,
&amp;remarks.ind);
CHECK_HANDLE( SQL_HANDLE_STMT, hstmt, rc ) ;
/* Fetch each row, and display */
while ((rc = SQLFetch(hstmt)) == SQL_SUCCESS) {
sprintf((char *)cur_name, "%s.%s", proc_schem.s, proc_name.s);
if (strcmp((char *)cur_name, (char *)pre_name) != 0) {
printf("\n%s\n", cur_name);
}
strcpy((char *)pre_name, (char *)cur_name);
printf(" %s", column_name.s);
switch (arg_type)
{ case SQL_PARAM_INPUT : printf(", Input"); break;
case SQL_PARAM_OUTPUT : printf(", Output"); break;
case SQL_PARAM_INPUT_OUTPUT : printf(", Input_Output"); break;
}
printf(", %s", type_name.s);
printf(" (%ld", length);
if (scale_ind != SQL_NULL_DATA) {
printf(", %d)\n", scale);
} else {
printf(")\n");
}
if (remarks.ind &gt; 0 ) {
printf("(remarks), %s)\n", remarks.s);
}
} /* endwhile */</pre>
</div>
</div>
<div class="section"><h4 class="sectiontitle">References</h4><div class="p"> <ul><li><a href="rzadpfnprcs.htm#rzadpfnprcs">SQLProcedures - Get list of procedure names</a></li>
</ul>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadphdapi.htm" title="This topic provides a description of each CLI function.">DB2 UDB CLI functions</a></div>
</div>
</div>
</body>
</html>