forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
61 lines
7.4 KiB
HTML
61 lines
7.4 KiB
HTML
<a name="EN-US_TOPIC_0000001188482174"></a><a name="EN-US_TOPIC_0000001188482174"></a>
|
|
|
|
<h1 class="topictitle1">SQLSetStmtAttr</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188482174__s4ef04ebecac648e690aa0b334b227d11"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188482174__a040372a2f1ef4c71acc0d9e6859af560"><strong id="EN-US_TOPIC_0000001188482174__b84235270616022">SQLSetStmtAttr</strong> sets attributes related to a statement.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188482174__sb9503a36ce6845f1b8298923303a09cd"><h4 class="sectiontitle">Prototype</h4><div class="codecoloring" codetype="Cpp" id="EN-US_TOPIC_0000001188482174__s3c136dab020d4dd3b6bcc066cf604e6d"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">SQLRETURN</span><span class="w"> </span><span class="nf">SQLSetStmtAttr</span><span class="p">(</span><span class="n">SQLHSTMT</span><span class="w"> </span><span class="n">StatementHandle</span>
|
|
<span class="w"> </span><span class="n">SQLINTEGER</span><span class="w"> </span><span class="n">Attribute</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">SQLPOINTER</span><span class="w"> </span><span class="n">ValuePtr</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">SQLINTEGER</span><span class="w"> </span><span class="n">StringLength</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188482174__s0ec859368cee45dfa54ce451b68f6a09"><h4 class="sectiontitle">Parameter</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188482174__ta8cf921f57b5409cb9df1b15280d2dc1" frame="border" border="1" rules="all"><caption><b>Table 1 </b>SQLSetStmtAttr parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188482174__re7ae27b8bfc04975bc07d49e9d707d80"><th align="left" class="cellrowborder" valign="top" width="23.27%" id="mcps1.3.3.2.2.3.1.1"><p id="EN-US_TOPIC_0000001188482174__ad99a9809e81c46c4810d454d2d24d734">Keyword</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="76.73%" id="mcps1.3.3.2.2.3.1.2"><p id="EN-US_TOPIC_0000001188482174__aa7a0987d5bf34334b93fd63ab7a3fab9">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188482174__r35fbf062413d4e0c82aa56cf2679523f"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001188482174__a26b9f61862c3439f96882fc3e50ba8b6">StatementtHandle</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.73%" headers="mcps1.3.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001188482174__a4f70eff589714fd590a694ffa2f49de1">Statement handle.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188482174__rf5350b08cd17493b95944abac59450ab"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001188482174__aa7b161e88eac45a18fad009d2933e44b">Attribute</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.73%" headers="mcps1.3.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001188482174__ab2ac8df5cc4f42889680fc2996212acd">Attribute to set.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188482174__ra3d5cfff64b74b219ac5ec696540d659"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001188482174__a718876d45f7e498f90356748be2cad95">ValuePtr</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.73%" headers="mcps1.3.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001188482174__a53df0cbbca674c94be2423b104cdc3c7">Pointer to the Attribute value. <strong id="EN-US_TOPIC_0000001188482174__b8423527061611">ValuePtr</strong> depends on the Attribute value, and can be a 32-bit unsigned integer value or a pointer to a null-terminated string, a binary buffer, and a driver-specified value. If <strong id="EN-US_TOPIC_0000001188482174__b84235270616122">ValuePtr</strong> parameter is driver-specific value, it may be signed integer.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188482174__r7e0c4ac62c7a4f1b89041457e5a3cbe0"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001188482174__ae37b99063a6748b7bd5e4c18ddf96628">StringLength</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.73%" headers="mcps1.3.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001188482174__a6e9ccca4a99e45b4adc769569cfe1a1b">If <strong id="EN-US_TOPIC_0000001188482174__b84235270616148">ValuePtr</strong> points to a string or a binary buffer, this parameter should be the length of <strong id="EN-US_TOPIC_0000001188482174__b84235270616157">*ValuePtr</strong>. If <strong id="EN-US_TOPIC_0000001188482174__b84235270616158">ValuePtr</strong> points to an integer, <strong id="EN-US_TOPIC_0000001188482174__b8423527061624">StringLength</strong> is ignored.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188482174__s3112acaff04b4417824198de633c0619"><h4 class="sectiontitle">Return Values</h4><ul id="EN-US_TOPIC_0000001188482174__u863d86d0a12f450db10ab34678cd2e83"><li id="EN-US_TOPIC_0000001188482174__l8b590e497d334d17958b18cd356d5a7e"><strong id="EN-US_TOPIC_0000001188482174__b842352706112950">SQL_SUCCESS</strong> indicates that the call succeeded.</li><li id="EN-US_TOPIC_0000001188482174__lb05d0f333e504d0d8d4f6b3c9f7c5aaf"><strong id="EN-US_TOPIC_0000001188482174__b842352706112952">SQL_SUCCESS_WITH_INFO</strong> indicates some warning information is displayed.</li><li id="EN-US_TOPIC_0000001188482174__lb88f2208d1a04c44be787825617d94be"><strong id="EN-US_TOPIC_0000001188482174__b842352706112954">SQL_ERROR</strong> indicates major errors, such as memory allocation and connection failures.</li><li id="EN-US_TOPIC_0000001188482174__l7484a9c22d8443dc8fd31daf86e45c48"><strong id="EN-US_TOPIC_0000001188482174__b842352706112956">SQL_INVALID_HANDLE</strong> indicates that invalid handles were called. Values returned by other APIs are similar to the preceding values.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188482174__s4982d8648a8c48348675d2d36f5e3923"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001188482174__ac487d4d7d35f4d48801f594eda3af58a">If <strong>SQLSetStmtAttr</strong> returns <strong>SQL_ERROR</strong> or <strong>SQL_SUCCESS_WITH_INFO</strong>, the application can then call <a href="dws_04_0143.html">SQLGetDiagRec</a>, set <strong>HandleType</strong> and <strong>Handle</strong> to <strong>SQL_HANDLE_STMT</strong> and <strong>StatementHandle</strong>, and obtain the <strong>SQLSTATE</strong> value. The <strong>SQLSTATE</strong> value provides the detailed function calling information.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188482174__sadb34460351542d2abe21fdc205bf4cb"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188482174__a7f04f2a2b1cf4fc3a6c5bfbc949923c5">See <a href="dws_04_0123.html">Examples</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0124.html">ODBC Interfaces</a></div>
|
|
</div>
|
|
</div>
|
|
|