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

140 lines
8.7 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="SQLMoreResults - Determine whether there are more result sets" />
<meta name="DC.Relation" scheme="URI" content="rzadphdapi.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="rzadpfnmrset" />
<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>SQLMoreResults</title>
</head>
<body id="rzadpfnmrset"><a name="rzadpfnmrset"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLMoreResults - Determine whether there are more result
sets</h1>
<div><div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLMoreResults()</samp> determines
whether there is more information available on the statement handle which
has been associated with a stored procedure that is returning result sets.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLMoreResults (SQLHSTMT StatementHandle);</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. SQLMoreResults arguments</caption><thead align="left"><tr><th align="left" valign="bottom" width="17.59259259259259%" id="d0e47">Data type</th>
<th align="left" valign="bottom" width="23.51851851851852%" id="d0e49">Argument </th>
<th align="left" valign="bottom" width="11.851851851851853%" id="d0e51">Use </th>
<th align="left" valign="bottom" width="47.03703703703704%" id="d0e53">Description </th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="17.59259259259259%" headers="d0e47 ">SQLHSTMT </td>
<td align="left" valign="top" width="23.51851851851852%" headers="d0e49 "><em>StatementHandle</em> </td>
<td align="left" valign="top" width="11.851851851851853%" headers="d0e51 ">input </td>
<td align="left" valign="top" width="47.03703703703704%" headers="d0e53 ">Statement handle</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p>This function is used to return multiple results
that are set in a sequential manner upon the processing of a stored procedure
that contains SQL queries. The cursors have been left open so that the result
sets remain accessible when the stored procedure has finished processing.</p>
<p>After
completely processing the first result set, the application can call <samp class="codeph">SQLMoreResults()</samp> to
determine if another result set is available. If the current result set has
unfetched rows, <samp class="codeph">SQLMoreResults()</samp> discards them by closing
the cursor and, if another result set is available, returns SQL_SUCCESS.</p>
<p>If
all the result sets have been processed, <samp class="codeph">SQLMoreResults()</samp> returns
SQL_NO_DATA_FOUND.</p>
<p>If <samp class="codeph">SQLFreeStmt()</samp> is called with
the SQL_CLOSE or SQL_DROP option, all pending result sets on this statement
handle are discarded.</p>
</div>
<div class="section"><h4 class="sectiontitle">Return codes</h4><div class="p"> <ul><li>SQL_SUCCESS</li>
<li>SQL_SUCCESS_WITH_INFO</li>
<li>SQL_STILL_EXECUTING</li>
<li>SQL_ERROR</li>
<li>SQL_INVALID_HANDLE</li>
<li>SQL_NO_DATA_FOUND</li>
</ul>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error conditions</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. SQLMoreResults SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="bottom" width="12.962962962962962%" id="d0e124">SQLSTATE </th>
<th align="left" valign="bottom" width="29.074074074074076%" id="d0e126">Description </th>
<th align="left" valign="bottom" width="57.96296296296296%" id="d0e128">Explanation </th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>40</strong>003 <strong>08</strong>S01</td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Communication link failure</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">The communication link between the application
and data source fails before the function is completed.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>58</strong>004 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Unexpected system failure</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">Unrecoverable system error.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>HY</strong>001 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Memory allocation failure</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">DB2<sup>®</sup> UDB CLI is unable to allocate memory
required to support the processing or completion of the function.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>HY</strong>010</td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Function sequence error</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">The function is called while in a data-at-processing
(<samp class="codeph">SQLParamData()</samp>, <samp class="codeph">SQLPutData()</samp>) operation.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>HY</strong>013 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Unexpected memory handling error</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">DB2 UDB CLI is unable to access memory required
to support the processing or completion of the function.</td>
</tr>
<tr><td valign="top" width="12.962962962962962%" headers="d0e124 "><strong>HY</strong>021</td>
<td valign="top" width="29.074074074074076%" headers="d0e126 ">Internal descriptor that is not valid </td>
<td valign="top" width="57.96296296296296%" headers="d0e128 ">The internal descriptor cannot be addressed or allocated,
or it contains a value that is not valid.</td>
</tr>
<tr><td align="left" valign="top" width="12.962962962962962%" headers="d0e124 "><strong>HY</strong>T00 </td>
<td align="left" valign="top" width="29.074074074074076%" headers="d0e126 ">Timeout expired</td>
<td align="left" valign="top" width="57.96296296296296%" headers="d0e128 ">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<p>In addition <samp class="codeph">SQLMoreResults()</samp> can return the SQLSTATEs
associated with <samp class="codeph">SQLExecute()</samp>.</p>
</div>
<div class="section"><h4 class="sectiontitle">Restrictions</h4><p> The ODBC specification of <samp class="codeph">SQLMoreResults()</samp> also
allow counts associated with the processing of parameterized INSERT, UPDATE,
and DELETE statements with arrays of input parameter values to be returned.
However, DB2 UDB
CLI does not support the return of such count information. </p>
</div>
<div class="section"><h4 class="sectiontitle">References</h4><div class="p"> <ul><li><a href="rzadpfnbindc.htm#rzadpfnbindc">SQLBindCol - Bind a column to an application variable</a></li>
<li><a href="rzadpfnbndpm.htm#rzadpfnbndpm">SQLBindParameter - Bind a parameter marker to a buffer</a></li>
</ul>
</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>
</body>
</html>