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

136 lines
8.5 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="SQLParamData - Get next parameter for which a data value is needed" />
<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="rzadpfnparad" />
<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>SQLParamData</title>
</head>
<body id="rzadpfnparad"><a name="rzadpfnparad"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLParamData - Get next parameter for which a data value is needed</h1>
<div><div class="section"></div>
<div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLParamData()</samp> is used with <samp class="codeph">SQLPutData()</samp> to
send long data in pieces. It can also be used to send fixed length data.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLParamData (SQLHSTMT hstmt,
SQLPOINTER *prgbValue);</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. SQLParamData arguments</caption><thead align="left"><tr><th align="left" valign="top" width="26.492537313432834%" id="d0e51">Data type</th>
<th align="left" valign="top" width="18.28358208955224%" id="d0e53">Argument</th>
<th align="left" valign="top" width="18.470149253731343%" id="d0e55">Use</th>
<th align="left" valign="top" width="36.75373134328358%" id="d0e57">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="26.492537313432834%" headers="d0e51 ">SQLHSTMT</td>
<td align="left" valign="top" width="18.28358208955224%" headers="d0e53 "><em>hstmt</em></td>
<td align="left" valign="top" width="18.470149253731343%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="36.75373134328358%" headers="d0e57 ">Statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="26.492537313432834%" headers="d0e51 ">SQLPOINTER *</td>
<td align="left" valign="top" width="18.28358208955224%" headers="d0e53 "><em>prgbValue</em></td>
<td align="left" valign="top" width="18.470149253731343%" headers="d0e55 ">Output</td>
<td align="left" valign="top" width="36.75373134328358%" headers="d0e57 ">Pointer to the value of the <em>rgbValue</em> argument
specified on the <samp class="codeph">SQLSetParam</samp> call.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p><samp class="codeph">SQLParamData()</samp> returns SQL_NEED_DATA
if there is at least one SQL_DATA_AT_EXEC parameter for which data still has
not been assigned. This function returns an application defined value in <em>prgbValue</em> supplied
by the application during the previous <samp class="codeph">SQLBindParam()</samp> call. <samp class="codeph">SQLPutData()</samp> is
called one or more times to send the parameter data. <samp class="codeph">SQLParamData()</samp> is
called to signal that all the data has been sent for the current parameter
and to advance to the next SQL_DATA_AT_EXEC parameter. SQL_SUCCESS is returned
when all the parameters have been assigned data values and the associated
statement has been processed successfully. If any errors occur during or before
actual statement processing, SQL_ERROR is returned.</p>
<div class="p">If <samp class="codeph">SQLParamData()</samp> returns
SQL_NEED_DATA, then only <samp class="codeph">SQLPutData()</samp> or <samp class="codeph">SQLCancel()</samp> calls
can be made. All other function calls using this statement handle fail. In
addition, all function calls referencing the parent <em>hdbc</em> of <em>hstmt</em> fail
if they involve changing any attribute or state of that connection. Those
following function calls on the parent <em>hdbc</em> are also not permitted:
<ul><li>SQLAllocConnect()</li>
<li>SQLAllocHandle()</li>
<li>SQLAllocStmt()</li>
<li>SQLSetConnectOption()</li>
</ul>
Should they be called during an SQL_NEED_DATA sequence, these functions
return SQL_ERROR with SQLSTATE of <strong>HY</strong>010 and the processing of the SQL_DATA_AT_EXEC
parameters is not affected.</div>
</div>
<div class="section"><h4 class="sectiontitle">Return codes</h4><ul><li>SQL_SUCCESS</li>
<li>SQL_SUCCESS_WITH_INFO</li>
<li>SQL_ERROR</li>
<li>SQL_INVALID_HANDLE</li>
<li>SQL_NEED_DATA</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Diagnostics</h4><div class="p"><samp class="codeph">SQLParamData()</samp> can
return any SQLSTATE returned by the <samp class="codeph">SQLExecDirect()</samp> and <samp class="codeph">SQLExecute()</samp> functions.
In addition, the following diagnostics can also be generated:
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. SQLParamData SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e177">SQLSTATE</th>
<th align="left" valign="top" width="25%" id="d0e179">Description</th>
<th align="left" valign="top" width="50%" id="d0e181">Explanation</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e177 "><strong>HY</strong>001</td>
<td align="left" valign="top" width="25%" headers="d0e179 ">Memory allocation failure</td>
<td align="left" valign="top" width="50%" headers="d0e181 ">The driver is unable to allocate memory required
to support the processing or completion of the function.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e177 "><strong>HY</strong>009</td>
<td align="left" valign="top" width="25%" headers="d0e179 ">Argument value that is not valid</td>
<td align="left" valign="top" width="50%" headers="d0e181 ">The argument <em>prgbValue</em> is a null pointer.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e177 "><strong>HY</strong>010</td>
<td align="left" valign="top" width="25%" headers="d0e179 ">Function sequence error</td>
<td align="left" valign="top" width="50%" headers="d0e181 "><samp class="codeph">SQLParamData()</samp> is called
out of sequence. This call is only valid after an <samp class="codeph">SQLExecDirect()</samp> or
an <samp class="codeph">SQLExecute()</samp>, or after an <samp class="codeph">SQLPutData()</samp> call.</td>
</tr>
<tr><td valign="top" width="25%" headers="d0e177 "><strong>HY</strong>021</td>
<td valign="top" width="25%" headers="d0e179 ">Internal descriptor that is not valid </td>
<td valign="top" width="50%" headers="d0e181 ">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="25%" headers="d0e177 "><strong>HY</strong>DE0</td>
<td align="left" valign="top" width="25%" headers="d0e179 ">No data at processing values pending</td>
<td align="left" valign="top" width="50%" headers="d0e181 ">Even though this function is called after
an <samp class="codeph">SQLExecDirect()</samp> or an <samp class="codeph">SQLExecute()</samp> call,
there are no SQL_DATA_AT_EXEC parameters (remaining) to process.</td>
</tr>
</tbody>
</table>
</div>
</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>