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

136 lines
8.2 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="SQLSetConnectOption - Set connection option" />
<meta name="DC.Relation" scheme="URI" content="rzadphdapi.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="rzadpfnscono" />
<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>SQLSetConnectOption</title>
</head>
<body id="rzadpfnscono"><a name="rzadpfnscono"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLSetConnectOption - Set connection 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">SQLSetConnectOption()</samp> has
been deprecated and replaced with <a href="rzadpfnsconx.htm#rzadpfnsconx"><samp class="codeph">SQLSetConnectAttr()</samp></a>.
Although this version of DB2<sup>®</sup> UDB CLI continues to support <samp class="codeph">SQLSetConnectOption()</samp>,
it is recommended that you begin using <samp class="codeph">SQLSetConnectAttr()</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">SQLSetConnectOption()</samp> sets
connection attributes for a particular connection.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLSetConnectOption (SQLHDBC hdbc,
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. SQLSetConnectOption arguments</caption><thead align="left"><tr><th align="left" valign="top" width="20%" id="d0e71">Data type</th>
<th align="left" valign="top" width="20%" id="d0e73">Argument</th>
<th align="left" valign="top" width="20%" id="d0e75">Use</th>
<th align="left" valign="top" width="40%" id="d0e77">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="20%" headers="d0e71 ">SQLHDBC</td>
<td align="left" valign="top" width="20%" headers="d0e73 "><em>hdbc</em></td>
<td align="left" valign="top" width="20%" headers="d0e75 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e77 ">Connection handle.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e71 ">SQLPOINTER</td>
<td align="left" valign="top" width="20%" headers="d0e73 "><em>vParam</em></td>
<td align="left" valign="top" width="20%" headers="d0e75 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e77 ">Value associated with <em>fOption</em>. Depending
on the option, this can be a pointer to a 32-bit integer value, or a character
string.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e71 ">SQLSMALLINT</td>
<td align="left" valign="top" width="20%" headers="d0e73 "><em>fOption</em></td>
<td align="left" valign="top" width="20%" headers="d0e75 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e77 ">Connect option to set, refer to <a href="rzadpfnsconx.htm#rzadpfnsconx__tbcono">Table 2</a> for
more information.</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">SQLSetConnectOption()</samp> provides
many of the same attribute functions as <samp class="codeph">SQLSetConnectAttr()</samp> prior
to V5R3. However, <samp class="codeph">SQLSetConnectOption()</samp> has since been deprecated,
and support for all new attribute functions has gone into <samp class="codeph">SQLSetConnectAttr()</samp>.
Users should migrate to the nondeprecated interface.<img src="./deltaend.gif" alt="End of change" /></p>
<p>All connection
and statement options set through the <samp class="codeph">SQLSetConnectOption()</samp> persist
until <samp class="codeph">SQLFreeConnect()</samp> is called or the next <samp class="codeph">SQLSetConnectOption()</samp> call.</p>
<p>The
format of information set through <em>vParam</em> depends on the specified <em>fOption</em>.
The option information can be either a 32-bit integer or a pointer to a null-terminated
character string.</p>
<p>Refer to <a href="rzadpfnsconx.htm#rzadpfnsconx__tbcono">Table 2</a> for
the appropriate connect options.</p>
<div class="note"><span class="notetitle">Note:</span> <img src="./delta.gif" alt="Start of change" />Because <samp class="codeph">SQLSetConnectOption()</samp> 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_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 2. SQLSetConnectOption SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e189">SQLSTATE</th>
<th align="left" valign="top" width="25%" id="d0e191">Description</th>
<th align="left" valign="top" width="50%" id="d0e193">Explanation</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e189 "><strong>HY</strong>001</td>
<td align="left" valign="top" width="25%" headers="d0e191 ">Memory allocation failure</td>
<td align="left" valign="top" width="50%" headers="d0e193 ">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="d0e189 "><strong>HY</strong>009</td>
<td align="left" valign="top" width="25%" headers="d0e191 ">Argument value that is not valid</td>
<td align="left" valign="top" width="50%" headers="d0e193 ">Given the <em>fOption</em> value, a value that
is not valid is specified for the argument <em>vParam</em>. <p>A <em>fOption</em> value
that is not valid is specified.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e189 "><strong>HY</strong>C00</td>
<td align="left" valign="top" width="25%" headers="d0e191 ">Driver not capable</td>
<td align="left" valign="top" width="50%" headers="d0e193 ">The specified <em>fOption</em> is not supported
by DB2 UDB
CLI or the server. <p>Given specified <em>fOption</em>value, the value specified
for the argument <em>vParam</em> is not supported.</p>
</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="rzadpfnsconx.htm">SQLSetConnectAttr - Set a connection attribute</a></div>
</div>
</div>
</body>
</html>