doc-exports/docs/dws/dev/dws_04_0136.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
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>
2024-05-16 07:24:04 +00:00

40 lines
5.7 KiB
HTML

<a name="EN-US_TOPIC_0000001188642028"></a><a name="EN-US_TOPIC_0000001188642028"></a>
<h1 class="topictitle1">SQLFetch</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188642028__s7137d813f8a24002884e274ee948203e"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188642028__a28a91884c05c4b0c803b09547ed5e9d9"><strong id="EN-US_TOPIC_0000001188642028__b842352706143658">SQLFetch</strong> advances the cursor to the next row of the result set and retrieves any bound columns.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642028__sfdc3eb23f8b8432895c5f83e3986e8ea"><h4 class="sectiontitle">Prototype</h4><div class="codecoloring" codetype="Cpp" id="EN-US_TOPIC_0000001188642028__s747ec9a2099940adb2992d2e625caed7"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">SQLRETURN</span><span class="w"> </span><span class="nf">SQLFetch</span><span class="p">(</span><span class="n">SQLHSTMT</span><span class="w"> </span><span class="n">StatementHandle</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642028__s3ee96aa6a9744135a80c76db9446cc4f"><h4 class="sectiontitle">Parameter</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188642028__tc2b051004ca2465e989366da49a33175" frame="border" border="1" rules="all"><caption><b>Table 1 </b>SQLFetch parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188642028__r2612dcb0fb30466ab11865c9da15771f"><th align="left" class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.3.3.2.2.3.1.1"><p id="EN-US_TOPIC_0000001188642028__a95cc96e862e3416da1fc3ed25b077e43">Keyword</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="76.88000000000001%" id="mcps1.3.3.2.2.3.1.2"><p id="EN-US_TOPIC_0000001188642028__a16e98629ed6b41b48e97ba9854da09c9">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188642028__rd8f6aebb349f40e995f287bda43d2671"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.3.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642028__a51c3e67f7eff4951b4fe65d6331e85a6">StatementHandle</p>
</td>
<td class="cellrowborder" valign="top" width="76.88000000000001%" headers="mcps1.3.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642028__a72dab5fbf8ea4492b8c8c475ebcc253a">Statement handle, obtained from <strong id="EN-US_TOPIC_0000001188642028__b842352706144658">SQLAllocHandle</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642028__sc5c643163b534d1f9bf6a6115d8223ac"><h4 class="sectiontitle">Return Values</h4><ul id="EN-US_TOPIC_0000001188642028__u2997a68b597f49a3bf4d918203fcb826"><li id="EN-US_TOPIC_0000001188642028__l7da7619e60b84714b8b60cc996475737"><strong id="EN-US_TOPIC_0000001188642028__b842352706112950">SQL_SUCCESS</strong> indicates that the call succeeded.</li><li id="EN-US_TOPIC_0000001188642028__l2505da6b979340fd89611ac3759e63fd"><strong id="EN-US_TOPIC_0000001188642028__b842352706112952">SQL_SUCCESS_WITH_INFO</strong> indicates some warning information is displayed.</li><li id="EN-US_TOPIC_0000001188642028__l5554fe53b02243979e8f7e9366179f46"><strong id="EN-US_TOPIC_0000001188642028__b842352706112954">SQL_ERROR</strong> indicates major errors, such as memory allocation and connection failures.</li><li id="EN-US_TOPIC_0000001188642028__lbd8eeeb229f84eb69a87b4e55c9365dc"><strong id="EN-US_TOPIC_0000001188642028__b84235270615213">SQL_NO_DATA</strong> indicates that the SQL statement does not return a result set.</li><li id="EN-US_TOPIC_0000001188642028__lc82d3f9e09ef48b4b0e98208c4cb7adb"><strong id="EN-US_TOPIC_0000001188642028__b842352706112956">SQL_INVALID_HANDLE</strong> indicates that invalid handles were called. Values returned by other APIs are similar to the preceding values.</li><li id="EN-US_TOPIC_0000001188642028__lcaada470fa504b7cb345f419cae89e63"><strong id="EN-US_TOPIC_0000001188642028__b842352706152119">SQL_STILL_EXECUTING</strong> indicates that the statement is being executed.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642028__s439bd857c0f54147a6ed4563d54a7dcd"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001188642028__abc0f9cbaf10c45b1ab484e551d028fb5">If <strong id="EN-US_TOPIC_0000001188642028__b56726131164942">SQLFetch</strong> returns <strong id="EN-US_TOPIC_0000001188642028__b55906287164948">SQL_ERROR</strong> or <strong id="EN-US_TOPIC_0000001188642028__b7583534164954">SQL_SUCCESS_WITH_INFO</strong>, the application can then call <a href="dws_04_0143.html">SQLGetDiagRec</a>, set <strong id="EN-US_TOPIC_0000001188642028__b4402431816502">HandleType</strong> and <strong id="EN-US_TOPIC_0000001188642028__b5343299916508">Handle</strong> to <strong id="EN-US_TOPIC_0000001188642028__b61155744165013">SQL_HANDLE_STMT</strong> and <strong id="EN-US_TOPIC_0000001188642028__b8134973165020">StatementHandle</strong>, and obtain the <strong id="EN-US_TOPIC_0000001188642028__b46852211165027">SQLSTATE</strong> value. The <strong id="EN-US_TOPIC_0000001188642028__b58783965165038">SQLSTATE</strong> value provides the detailed function calling information.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642028__s4982f324d1874dc78bf053433a169dbb"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188642028__a597cf68ecd314ef3ac4cf4bcb72c189c">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>