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.8 KiB
HTML
61 lines
7.8 KiB
HTML
<a name="EN-US_TOPIC_0000001233563253"></a><a name="EN-US_TOPIC_0000001233563253"></a>
|
|
|
|
<h1 class="topictitle1">SQLSetConnectAttr</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001233563253__s7cb8b8d38d22481cbc3f243082e7ea53"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001233563253__ab33065429dcd4f7abc5e0d3d210d74aa"><strong id="EN-US_TOPIC_0000001233563253__b842352706153936">SQLSetConnectAttr</strong> sets connection attributes.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563253__s1534bd2482d84acf8ed673b9ac5f57cf"><h4 class="sectiontitle">Prototype</h4><div class="codecoloring" codetype="Cpp" id="EN-US_TOPIC_0000001233563253__s75373a2276e24e1e8d6eced77ff7a767"><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">SQLSetConnectAttr</span><span class="p">(</span><span class="n">SQLHDBC</span><span class="w"> </span><span class="n">ConnectionHandle</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_0000001233563253__s0f1b4297fdb74ac78a9d1166a6295d0f"><h4 class="sectiontitle">Parameter</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233563253__t954a2ed218134d1d85849f71774c81c1" frame="border" border="1" rules="all"><caption><b>Table 1 </b>SQLSetConnectAttr parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233563253__rf090563540584ef58f872e908fd75d19"><th align="left" class="cellrowborder" valign="top" width="23.27%" id="mcps1.3.3.2.2.3.1.1"><p id="EN-US_TOPIC_0000001233563253__a0834bd2ccf584be38c60c000855293f1">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_0000001233563253__a93fef3743c964e3e97738a9847e29880">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233563253__r7f7f7464c412431294aec888e21d1c76"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001233563253__a94844f83b31d4fc1bd824af7538041c3">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_0000001233563253__a8eb46c8e620840ad8aa9cfb3c9749ec7">Connection handle.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563253__r343eec64279744edbe1b05364e8f3a48"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001233563253__a186025e7fd8f487faf8eb4b0cf474b06">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_0000001233563253__a109206cbb2344453b93b970b090a9095">Attribute to set.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563253__rbd40bd0016b54d4fb1ad82d5083f35ad"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001233563253__a904f79cabb304b4c84af1cc138e457b4">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_0000001233563253__add0f2cc09ad14a3694e880697791714c">Pointer to the Attribute value. <strong id="EN-US_TOPIC_0000001233563253__b842352706153959">ValuePtr</strong> depends on the Attribute value, and can be a 32-bit unsigned integer value or a null-terminated string. If <strong id="EN-US_TOPIC_0000001233563253__b842352706154032">ValuePtr</strong> parameter is driver-specific value, it may be signed integer.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563253__rfec7881b26964212b6dcf1085cc7ab3e"><td class="cellrowborder" valign="top" width="23.27%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001233563253__a67ffceca5f4c47d09146e1f4813d7c1e">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_0000001233563253__afd78bc790b2a4456a01157ce307efed1">If <strong id="EN-US_TOPIC_0000001233563253__b842352706154119">ValuePtr</strong> points to a string or a binary buffer, this parameter should be the length of <strong id="EN-US_TOPIC_0000001233563253__b842352706154311">*ValuePtr</strong>. If <strong id="EN-US_TOPIC_0000001233563253__b842352706154324">ValuePtr</strong> points to an integer, <strong id="EN-US_TOPIC_0000001233563253__b842352706154329">StringLength</strong> is ignored.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563253__s16a18350e7be4a7b9eed4f151bee905e"><h4 class="sectiontitle">Return Values</h4><ul id="EN-US_TOPIC_0000001233563253__ueb6fcf9f3c044caf813780e7954faedd"><li id="EN-US_TOPIC_0000001233563253__lf2067ddbf1a8446e888a43b796de28e4"><strong id="EN-US_TOPIC_0000001233563253__b842352706112950">SQL_SUCCESS</strong> indicates that the call succeeded.</li><li id="EN-US_TOPIC_0000001233563253__l5313558af9c94bb1b5a74d7500df1a9b"><strong id="EN-US_TOPIC_0000001233563253__b842352706112952">SQL_SUCCESS_WITH_INFO</strong> indicates some warning information is displayed.</li><li id="EN-US_TOPIC_0000001233563253__lcb0522a9284843649a81a3113c03d691"><strong id="EN-US_TOPIC_0000001233563253__b842352706112954">SQL_ERROR</strong> indicates major errors, such as memory allocation and connection failures.</li><li id="EN-US_TOPIC_0000001233563253__l47a30f9ee584461b8076c5e25db98aab"><strong id="EN-US_TOPIC_0000001233563253__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_0000001233563253__s4c87ed1d94c648178e3c648238798ce1"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001233563253__a0d0984f7b3fe4ce0b89ea631bc0216fc">If <strong id="EN-US_TOPIC_0000001233563253__b19293286165640">SQLSetConnectAttr</strong> returns <strong id="EN-US_TOPIC_0000001233563253__b40854083165648">SQL_ERROR</strong> or <strong id="EN-US_TOPIC_0000001233563253__b7290150165656">SQL_SUCCESS_WITH_INFO</strong>, the application can then call <a href="dws_04_0143.html">SQLGetDiagRec</a>, set <strong id="EN-US_TOPIC_0000001233563253__b5686337616574">HandleType</strong> and <strong id="EN-US_TOPIC_0000001233563253__b11430631165712">Handle</strong> to <strong id="EN-US_TOPIC_0000001233563253__b66952723165720">SQL_HANDLE_DBC</strong> and <strong id="EN-US_TOPIC_0000001233563253__b25641669165731">ConnectionHandle</strong>, and obtain the <strong id="EN-US_TOPIC_0000001233563253__b32963009165742">SQLSTATE</strong> value. The <strong id="EN-US_TOPIC_0000001233563253__b25739559165753">SQLSTATE</strong> value provides the detailed function calling information.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563253__s960cdfc53c4848a4a69c8451f8f9fe59"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233563253__a02b79f10e845454c8df9ce7e9ee9898a">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>
|
|
|