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

187 lines
12 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="SQLGetStmtAttr - Get the value of a statement attribute" />
<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="rzadpfngstma" />
<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>SQLGetStmtAttr</title>
</head>
<body id="rzadpfngstma"><a name="rzadpfngstma"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLGetStmtAttr - Get the value of a statement attribute</h1>
<div><div class="section"></div>
<div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLGetStmtAttr()</samp> returns
the current settings of the specified statement attribute.</p>
<p>These options
are set using the <samp class="codeph">SQLSetStmtAttr()</samp> function. This function
is similar to <samp class="codeph">SQLGetStmtOption()</samp>, both functions are supported
for compatibility reasons.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLGetStmtAttr( SQLHSTMT hstmt,
SQLINTEGER fAttr,
SQLPOINTER pvParam,
SQLINTEGER bLen,
SQLINTEGER *sLen);</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. SQLGetStmtAttr arguments</caption><thead align="left"><tr><th align="left" valign="top" width="22.490706319702603%" id="d0e56">Data type</th>
<th align="left" valign="top" width="19.33085501858736%" id="d0e58">Argument</th>
<th align="left" valign="top" width="19.33085501858736%" id="d0e60">Use</th>
<th align="left" valign="top" width="38.847583643122675%" id="d0e62">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="22.490706319702603%" headers="d0e56 ">SQLHSTMT</td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e58 "><em>hstmt</em></td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e60 ">Input</td>
<td align="left" valign="top" width="38.847583643122675%" headers="d0e62 ">Statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="22.490706319702603%" headers="d0e56 ">SQLINTEGER</td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e58 "><em>fAttr</em></td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e60 ">Input</td>
<td align="left" valign="top" width="38.847583643122675%" headers="d0e62 ">Attribute to retrieve. Refer to <a href="#rzadpfngstma__tbstmta">Table 2</a> for
more information.</td>
</tr>
<tr><td align="left" valign="top" width="22.490706319702603%" headers="d0e56 ">SQLPOINTER</td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e58 "><em>pvParam</em></td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e60 ">Output</td>
<td align="left" valign="top" width="38.847583643122675%" headers="d0e62 ">Pointer to buffer for requested attribute.</td>
</tr>
<tr><td align="left" valign="top" width="22.490706319702603%" headers="d0e56 ">SQLINTEGER</td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e58 "><em>bLen</em></td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e60 ">Input</td>
<td align="left" valign="top" width="38.847583643122675%" headers="d0e62 ">Maximum number of bytes to store in <em>pvParam</em>,
if the attribute is a character string; otherwise, unused.</td>
</tr>
<tr><td align="left" valign="top" width="22.490706319702603%" headers="d0e56 ">SQLINTEGER *</td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e58 "><em>sLen</em></td>
<td align="left" valign="top" width="19.33085501858736%" headers="d0e60 ">Output</td>
<td align="left" valign="top" width="38.847583643122675%" headers="d0e62 ">Length of output data if the attribute is
a character string; otherwise, unused.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4>
<div class="tablenoborder"><a name="rzadpfngstma__tbstmta"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rzadpfngstma__tbstmta" width="100%" frame="hsides" border="1" rules="all"><caption>Table 2. Statement attributes</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e134"><em>fAttr</em></th>
<th align="left" valign="top" width="9.807692307692308%" id="d0e137">Data type</th>
<th align="left" valign="top" width="65.1923076923077%" id="d0e139">Contents</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_APP_PARAM_DESC</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">The descriptor handle used by the application
to provide parameter values for this statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_APP_ROW_DESC</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">The descriptor handle for the application
to retrieve row data using the statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_CURSOR_SCROLLABLE</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">A 32-bit integer value that specifies if
cursors opened for this statement handle should be scrollable. <ul><li>SQL_FALSE Cursors are not scrollable, and <samp class="codeph">SQLFetchScroll()</samp> cannot
be used against them. This is the default.</li>
<li>SQL_TRUE Cursors are scrollable. <samp class="codeph">SQLFetchScroll()</samp> can
be used to retrieve data from these cursors.</li>
</ul>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_CURSOR_TYPE</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">A 32-bit integer value that specifies the
behavior of cursors opened for this statement handle. <ul><li>SQL_CURSOR_FORWARD_ONLY Cursors are not scrollable, and <samp class="codeph">SQLFetchScroll()</samp> cannot
be used against them. This is the default.</li>
<li>SQL_DYNAMIC Cursors are scrollable. <samp class="codeph">SQLFetchScroll()</samp> can
be used to retrieve data from these cursors.</li>
</ul>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_FOR_FETCH_ONLY</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">Indicates if cursors opened for this statement
handle should be read-only. <ul><li>SQL_FALSE - Cursors can be used for positioned updates and deletes. This
is the default.</li>
<li>SQL_TRUE - Cursors are read-only and cannot be used for positioned updates
or deletes.</li>
</ul>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_IMP_PARAM_DESC</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">The descriptor handle used by the CLI implementation
to provide parameter values for this statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_IMP_ROW_DESC</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">The descriptor handle used by the CLI implementation
to retrieve row data using this statement handle.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e134 ">SQL_ATTR_ROWSET_SIZE</td>
<td align="left" valign="top" width="9.807692307692308%" headers="d0e137 ">Integer</td>
<td align="left" valign="top" width="65.1923076923077%" headers="d0e139 ">A 32bit integer value that specifies the
number of rows in the rowset. This is the number of rows returned by each
call to <samp class="codeph">SQLExtendedFetch()</samp>. The default value is 1.</td>
</tr>
</tbody>
</table>
</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>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Diagnostics</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 3. SQLGetStmtAttr SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e254">SQLSTATE</th>
<th align="left" valign="top" width="25%" id="d0e256">Description</th>
<th align="left" valign="top" width="50%" id="d0e258">Explanation</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e254 "><strong>HY</strong>001</td>
<td align="left" valign="top" width="25%" headers="d0e256 ">Memory allocation failure</td>
<td align="left" valign="top" width="50%" headers="d0e258 ">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="d0e254 "><strong>HY</strong>009</td>
<td align="left" valign="top" width="25%" headers="d0e256 ">Argument value that is not valid</td>
<td align="left" valign="top" width="50%" headers="d0e258 ">The argument <em>pvParam</em> is a null pointer.
<p>An <em>fAttr</em> that is not valid value is specified.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e254 "><strong>HY</strong>C00</td>
<td align="left" valign="top" width="25%" headers="d0e256 ">Driver not capable</td>
<td align="left" valign="top" width="50%" headers="d0e258 ">DB2<sup>®</sup> UDB CLI recognizes the option but does
not support it.</td>
</tr>
</tbody>
</table>
</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>