154 lines
10 KiB
HTML
154 lines
10 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="SQLSetStmtOption - Set statement option" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzadphdapi.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzadpfnsstma.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzadpfnsconx.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="rzadpfnsstmo" />
|
|
<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>SQLSetStmtOption</title>
|
|
</head>
|
|
<body id="rzadpfnsstmo"><a name="rzadpfnsstmo"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">SQLSetStmtOption - Set statement option</h1>
|
|
<div><div class="section"></div>
|
|
<div class="section"><h4 class="sectiontitle">Purpose</h4> <p><img src="./delta.gif" alt="Start of change" /><samp class="codeph">SQLSetStmtOption()</samp> has
|
|
been deprecated and replaced with <a href="rzadpfnsstma.htm#rzadpfnsstma"><samp class="codeph">SQLSetStmtAttr()</samp></a>.
|
|
Although this version of DB2<sup>®</sup> UDB CLI continues to support <samp class="codeph">SQLSetStmtOption()</samp>,
|
|
it is recommended that you begin using <samp class="codeph">SQLSetStmtAttr()</samp> in
|
|
your DB2 UDB
|
|
CLI programs so that they conform to the latest standards.<img src="./deltaend.gif" alt="End of change" /></p>
|
|
<p><samp class="codeph">SQLSetStmtOption()</samp> sets
|
|
an attribute of a specific statement handle. To set an option for all statement
|
|
handles associated with a connection handle, the application can call <samp class="codeph">SQLSetConnectAttr()</samp> (See <a href="rzadpfnsconx.htm">SQLSetConnectAttr - Set a connection attribute</a> for additional details).</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLSetStmtOption (SQLHSTMT hstmt,
|
|
SQLSMALLINT fOption,
|
|
SQLPOINTER vParam);</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. SQLSetStmtOption arguments</caption><thead align="left"><tr><th align="left" valign="top" width="21.062618595825427%" id="d0e77">Data type</th>
|
|
<th align="left" valign="top" width="19.165085388994306%" id="d0e79">Argument</th>
|
|
<th align="left" valign="top" width="10.62618595825427%" id="d0e81">Use</th>
|
|
<th align="left" valign="top" width="49.146110056926%" id="d0e83">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="21.062618595825427%" headers="d0e77 ">SQLHSTMT</td>
|
|
<td align="left" valign="top" width="19.165085388994306%" headers="d0e79 "><em>hstmt</em></td>
|
|
<td align="left" valign="top" width="10.62618595825427%" headers="d0e81 ">Input</td>
|
|
<td align="left" valign="top" width="49.146110056926%" headers="d0e83 ">Statement handle.</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="21.062618595825427%" headers="d0e77 ">SQLPOINTER</td>
|
|
<td align="left" valign="top" width="19.165085388994306%" headers="d0e79 "><em>vParam</em></td>
|
|
<td align="left" valign="top" width="10.62618595825427%" headers="d0e81 ">Input</td>
|
|
<td align="left" valign="top" width="49.146110056926%" headers="d0e83 ">Value associated with <em>fOption</em>. <em>vParam</em> can
|
|
be a pointer to a 32-bit integer value or a character string.</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="21.062618595825427%" headers="d0e77 ">SQLSMALLINT</td>
|
|
<td align="left" valign="top" width="19.165085388994306%" headers="d0e79 "><em>fOption</em></td>
|
|
<td align="left" valign="top" width="10.62618595825427%" headers="d0e81 ">Input</td>
|
|
<td align="left" valign="top" width="49.146110056926%" headers="d0e83 ">Option to set. Refer to <a href="rzadpfnsstma.htm#rzadpfnsstma__tbstmto">Table 2</a> for
|
|
the list of settable statement options.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Usage</h4><p><img src="./delta.gif" alt="Start of change" />The <samp class="codeph">SQLSetStmtOption()</samp> provides
|
|
many of the same attribute functions as <samp class="codeph">SQLSetStmtAttr()</samp> prior
|
|
to V5R3. However, it has since been deprecated, and support for all new attribute
|
|
functions has gone into SQLSetStmtAttr(). Users should migrate to the nondeprecated
|
|
interface.<img src="./deltaend.gif" alt="End of change" /></p>
|
|
<p>Statement options for an <em>hstmt</em> remain in effect until
|
|
they are changed by another call to <samp class="codeph">SQLSetStmtOption()</samp> or
|
|
the <em>hstmt</em> is dropped by calling <samp class="codeph">SQLFreeStmt()</samp> with
|
|
the SQL_DROP option. Calling <samp class="codeph">SQLFreeStmt()</samp> with the SQL_CLOSE,
|
|
SQL_UNBIND, or SQL_RESET_PARAMS options does not reset statement options.</p>
|
|
<p>The
|
|
format of information set through <em>vParam</em> depends on the specified <em>fOption</em>.
|
|
The format of each is noted in <a href="rzadpfnsstma.htm#rzadpfnsstma__tbstmto">Table 2</a>.</p>
|
|
<p>Refer
|
|
to <a href="rzadpfnsstma.htm#rzadpfnsstma__tbstmto">Table 2</a> for the proper
|
|
statement options.</p>
|
|
<div class="note"><span class="notetitle">Note:</span> <img src="./delta.gif" alt="Start of change" />Because the <samp class="codeph">SQLSetStmtOption()</samp> function
|
|
has been deprecated, not all the options listed in the table are supported." <img src="./deltaend.gif" alt="End of change" /></div>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Return codes</h4><ul><li>SQL_SUCCESS</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 2. SQLStmtOption SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="16.666666666666664%" id="d0e198">SQLSTATE</th>
|
|
<th align="left" valign="top" width="14.75095785440613%" id="d0e200">Description</th>
|
|
<th align="left" valign="top" width="68.5823754789272%" id="d0e202">Explanation</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="16.666666666666664%" headers="d0e198 "><strong>40</strong>003 <strong>*</strong></td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">Statement completion unknown</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">The communication link between the CLI and
|
|
the data source fails before the function completes processing.</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="16.666666666666664%" headers="d0e198 "><strong>HY</strong>000</td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">General error</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">An error occurred for which there is no specific
|
|
SQLSTATE and for which no implementation defined SQLSTATE is defined. The
|
|
error message returned by SQLError in the argument <em>szErrorMsg</em> describes
|
|
the error and its cause.</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="16.666666666666664%" headers="d0e198 "><strong>HY</strong>001</td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">Memory allocation failure</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">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="16.666666666666664%" headers="d0e198 "><strong>HY</strong>009</td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">Argument value that is not valid</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">Given the specified <em>fOption</em> value,
|
|
a value that is not valid is specified for the argument <em>vParam</em>. <p>A <em>fOption</em> that
|
|
is not valid value is specified.</p>
|
|
<p>The argument <em>szSchemaName</em> or <em>szTableName</em> is
|
|
a null pointer. </p>
|
|
</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="16.666666666666664%" headers="d0e198 "><strong>HY</strong>010</td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">Function sequence error</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">The function is called out of sequence.</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="16.666666666666664%" headers="d0e198 "><strong>HY</strong>C00</td>
|
|
<td align="left" valign="top" width="14.75095785440613%" headers="d0e200 ">Driver not capable</td>
|
|
<td align="left" valign="top" width="68.5823754789272%" headers="d0e202 ">The driver or the data sources does not support
|
|
the specified option.</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 class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rzadpfnsstma.htm">SQLSetStmtAttr - Set a statement attribute</a></div>
|
|
<div><a href="rzadpfnsconx.htm">SQLSetConnectAttr - Set a connection attribute</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |