193 lines
12 KiB
HTML
193 lines
12 KiB
HTML
<?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="SQLDescribeParam - Return description of a parameter marker" />
|
||
<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="rzadpfndescprm" />
|
||
<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>SQLDescribeParam</title>
|
||
</head>
|
||
<body id="rzadpfndescprm"><a name="rzadpfndescprm"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">SQLDescribeParam - Return description of a parameter marker</h1>
|
||
<div><div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLDescribeParam()</samp> returns the description of a parameter marker associated with a prepared
|
||
SQL statement. This information is also available in the fields of the implementation
|
||
parameter descriptor (IPD).</p>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLDescribeParam (SQLHSTMT StatementHandle,
|
||
SQLSMALLINT ParameterNumber,
|
||
SQLSMALLINT *DataTypePtr,
|
||
SQLINTEGER *ParameterSizePtr,
|
||
SQLSMALLINT *DecimalDigitsPtr,
|
||
SQLSMALLINT *NullablePtr);</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. SQLDescribeParam arguments</caption><thead align="left"><tr><th align="left" valign="bottom" width="17.59259259259259%" id="d0e45">Data type</th>
|
||
<th align="left" valign="bottom" width="23.51851851851852%" id="d0e47">Argument</th>
|
||
<th align="left" valign="bottom" width="11.851851851851853%" id="d0e49">Use</th>
|
||
<th align="left" valign="bottom" width="47.03703703703704%" id="d0e51">Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLHSTMT</td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>StatementHandle</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Input</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Statement handle.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLINTEGER *</td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>ParameterSizePtr</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Output</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Pointer to a buffer in which to return the
|
||
size of the column or expression of the corresponding parameter marker as
|
||
defined by the data source.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLSMALLINT *</td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>DataTypePtr</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Output</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Pointer to a buffer in which to return the
|
||
SQL data type of the parameter.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLSMALLINT *</td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>DecimalDigitsPtr</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Output</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Pointer to a buffer in which to return the
|
||
number of decimal digits of the column or expression of the corresponding
|
||
parameter as defined by the data source.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLSMALLINT *</td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>NullablePtr</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Output</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Pointer to a buffer in which to return a
|
||
value that indicates whether the parameter allows NULL values. This value
|
||
is read from the SQL_DESC_NULLABLE field of the IPD. <div class="p"> <ul><li>SQL_NO_NULLS – The parameter does not allow NULL values (this is the default
|
||
value).</li>
|
||
<li>SQL_NULLABLE – The parameter allows NULL values.</li>
|
||
<li>SQL_NULLABLE_UNKNOWN – Cannot determine if the parameter allows NULL values.</li>
|
||
</ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e45 ">SQLSMALLINT </td>
|
||
<td align="left" valign="top" width="23.51851851851852%" headers="d0e47 "><em>ParameterNumber</em></td>
|
||
<td align="left" valign="top" width="11.851851851851853%" headers="d0e49 ">Input</td>
|
||
<td align="left" valign="top" width="47.03703703703704%" headers="d0e51 ">Parameter marker number ordered sequentially
|
||
in increasing parameter order, starting at 1.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Usage</h4><p>Parameter markers are numbered in increasing
|
||
parameter order, starting with 1, in the order they appear in the SQL statement.</p>
|
||
<p><samp class="codeph">SQLDescribeParam()</samp> does
|
||
not return the type (input, output, or both input and output) of a parameter
|
||
in an SQL statement. Except in calls to procedures, all parameters in SQL
|
||
statements are input parameters. To determine the type of each parameter in
|
||
a call to a procedure, an application calls <samp class="codeph">SQLProcedureColumns()</samp>.</p>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Return codes</h4><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 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 2. SQLDescribeParam SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="bottom" width="30%" id="d0e165">SQLSTATE</th>
|
||
<th align="left" valign="bottom" width="29.259259259259256%" id="d0e167">Description</th>
|
||
<th align="left" valign="bottom" width="40.74074074074074%" id="d0e169">Explanation </th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>01</strong>000</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Warning</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">Informational message. (Function returns
|
||
SQL_SUCCESS_WITH_INFO.) </td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>07</strong>009</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Descriptor index that is not valid</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The value specified for the argument <span class="synph"><span class="var">ParameterNumber</span></span> less
|
||
than 1. <p>The value specified for the argument <span class="synph"><span class="var">ParameterNumber</span></span> is
|
||
greater than the number of parameters in the associated SQL statement.</p>
|
||
<p>The
|
||
parameter marker is part of a non-DML statement.</p>
|
||
<p>The parameter marker
|
||
is part of a SELECT list.</p>
|
||
</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>08</strong>S01</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Communication link failure</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The communication link between DB2<sup>®</sup> UDB CLI and
|
||
the data source to which it is connected fails before the function completes
|
||
processing.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>21</strong>S01</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Insert value list does not match column list</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The number of parameters in the INSERT statement
|
||
does not match the number of columns in the table named in the statement.
|
||
</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>HY</strong>000</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">General error</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 "> </td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>HY</strong>001</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Memory allocation failure</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">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="30%" headers="d0e165 "><strong>HY</strong>008</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Operation cancelled.</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 "> </td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>HY</strong>009</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Argument value that is not valid</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The argument <em>DataTypePtr</em>, <em>ParameterSizePtr</em>, <em>DecimalDigitsPtr</em>,
|
||
or <em>NullablePtr </em> is a null pointer.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>HY</strong>010</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Function sequence error</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The function is called before calling <samp class="codeph">SQLPrepare()</samp> or
|
||
<samp class="codeph">SQLExecDirect()</samp> for the <span class="synph"><span class="var">StatementHandle</span></span>.</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="30%" headers="d0e165 "><strong>HY</strong>013</td>
|
||
<td align="left" valign="top" width="29.259259259259256%" headers="d0e167 ">Unexpected memory handling error</td>
|
||
<td align="left" valign="top" width="40.74074074074074%" headers="d0e169 ">The function call cannot be processed because
|
||
the underlying memory objects can not be accessed, possibly because of low
|
||
memory conditions.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Restrictions</h4><p>None.</p>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">References</h4><div class="p"> <ul><li><a href="rzadpfnbndpa.htm#rzadpfnbndpa">SQLBindParam - Bind a buffer to a parameter marker</a></li>
|
||
<li><a href="rzadpfncan.htm#rzadpfncan">SQLCancel - Cancel statement</a></li>
|
||
<li><a href="rzadpfnexec.htm#rzadpfnexec">SQLExecute - Execute a statement</a></li>
|
||
<li><a href="rzadpfnprep.htm#rzadpfnprep">SQLPrepare - Prepare a statement</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> |