ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaik_5.4.0.1/odbcapis.htm

614 lines
36 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="ODBC 3.x APIs Notes" />
<meta name="abstract" content="The following table lists ODBC 3.x APIs by their associated task and identifies considerations for each API." />
<meta name="description" content="The following table lists ODBC 3.x APIs by their associated task and identifies considerations for each API." />
<meta name="DC.Relation" scheme="URI" content="rzaikodbcapifunctions.htm" />
<meta name="DC.Relation" scheme="URI" content="rzaiksqlconsider.htm" />
<meta name="DC.Relation" scheme="URI" content="rzaikodbcapilimits.htm" />
<meta name="DC.Relation" scheme="URI" content="http://www.microsoft.com/" />
<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="odbcapis" />
<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>ODBC 3.x APIs Notes</title>
</head>
<body id="odbcapis"><a name="odbcapis"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">ODBC 3.x APIs Notes<sup>®</sup></h1>
<div><p>The following table lists ODBC 3.x APIs by their associated task
and identifies considerations for each API.</p>
<div class="section"><div class="note"><span class="notetitle">Notes:</span> <ul><li>The iSeries™ Access
for Windows<sup>®</sup> ODBC
Driver is a Unicode driver; however, ANSI applications will still continue
to work with it. The ODBC Driver Manager will handle converting an ANSI ODBC
API call to the wide version before calling the iSeries Access for Windows ODBC
Driver. To write a Unicode application, you must call the wide version for
some of these APIs. When writing an application to the wide ODBC interface,
you need to know whether the length for each API is defined as character,
in bytes, or if the length is not applicable. Refer to the 'Type' column in
the following table for this information.</li>
<li>For more details on how these APIs work, search for ODBC at the Microsoft<sup>®</sup> Web
site.</li>
</ul>
</div>
</div>
<div class="section">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="8.125%" id="d0e48">Type</th>
<th valign="top" width="21.25%" id="d0e50">API</th>
<th valign="top" width="25.624999999999996%" id="d0e52">Description</th>
<th valign="top" width="45%" id="d0e54">Other considerations</th>
</tr>
</thead>
<tbody><tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Connecting to a
data source</strong> <div class="note"><span class="notetitle">Note:</span> For information on how the connection APIs prompt signon
dialogs see <a href="signon.htm#signon">Signon dialog behavior</a>. .Also see <a href="connectionpooling.htm#connectionpooling">connection
pooling</a> for more information.</div>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLAllocHandle</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Obtains an environment and connection handle. One environment
handle is used for one or more connections. May also allocate a statement
or a descriptor handle.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLConnect</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Connects to a specific data source name with a specific
user ID and password.</td>
<td valign="top" width="45%" headers="d0e54 ">There is an option to control whether this API prompts
a signon dialog when the user ID and password are not specified. This option
can be set from the <strong>Connection option</strong>s dialog on the <strong>General</strong> tab
of the DSN. </td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLDriverConnect</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Connects to a specific driver by connection string or
requests that the Driver Manager and driver display connection dialogs for
the user. </td>
<td valign="top" width="45%" headers="d0e54 ">Uses all keywords. Only DSN is required. Other
values are optional. Refer to <a href="connectkeywords.htm#connectkeywords">Connection string keywords</a> for
more information. </td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLBrowseConnect </td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns successive levels of connection attributes and
valid attribute values. When a value has been specified for each connection
attribute, connects to the data source. </td>
<td valign="top" width="45%" headers="d0e54 ">To make a connection attempt the SYSTEM keyword
and either the DSN or DRIVER keywords must be specified. All the other keywords
are optional. Note, the PWD keyword is not returned in the output string for
security purposes. Refer to <a href="connectkeywords.htm#connectkeywords">Connection string keywords</a> for
more implementation issues.</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Get information
regarding a driver or data source</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetInfo</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns information about a specific driver and data
source.</td>
<td valign="top" width="45%" headers="d0e54 ">Special attributes returned differently based on
attributes and keywords.The information that is returned by SQLGetInfo can
vary depending on which keywords and attributes are in use. The InfoType options
that are affected are: <ul><li>SQL_CATALOG_NAME_SEPARATOR By default a period is returned. If the connection
string keyword NAM is set to 1, a comma is returned.</li>
<li>SQL_CURSOR_COMMIT_BEHAVIOR, SQL_CURSOR_ROLLBACK_BEHAVIOR By default
SQL_CB_PRESERVE is returned. If the connection attribute, 1204, is set SQL_CB_DELETE
is returned.</li>
<li>SQL_DATA_SOURCE_READ_ONLY By default N is returned. If the connection
string keyword CONNTYPE is set to 0 then Y is returned.</li>
<li>SQL_IDENTIFIER_QUOTE_CHAR By default a double-quote mark is returned.
If the application in use is MS QUERY (MSQRY32) then a single blank is returned. </li>
<li>SQL_IDENTIFIER_CASE By default SQL_IC_UPPER is returned. If the connection
string keyword DEBUG has the option 2 set then SQL_IC_MIXED is rteurned.</li>
<li>SQL_MAX_QUALIFIER_NAME_LEN By default 18 is returned. If the connection
string keyword DEBUG has the 8 bit set then 0 is returned.</li>
<li>SQLDriverVer - Returns the version of the driver in the format of VV.RR.SSST,
where, <ul><li>VV represents the version of iSeries Access for Windows, </li>
<li>RR is the release identifier of iSeries Access for Windows,</li>
<li>SSS is the number of the service pack that has been applied to iSeries Access
for Windows,
and</li>
<li>T is the version of the test fix that has been applied for an ODBC driver
problem, otherwise, it is 0.</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLGetTypeInfo</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns information about supported data types.</td>
<td valign="top" width="45%" headers="d0e54 ">Different result sets can be seen when running to
different iSeries server
versions. For example, the BIGINT data type is only in the result set when
running to V4R5 or later servers. <p>The "LONG VARCHAR" data type is not
returned in the result set. This is due to problems that were seen with some
applications expecting to specify a length with this type. "LONG VARCHAR
FOR BIT DATA" and "LONG VARGRAPHIC" are also not returned for similar reasons.</p>
<p>
In the TYPE_NAME column, when a data type requires a value to be in parentheses,
the parentheses are included in the data type name. However the parentheses
are omitted when the parentheses would end up at the end of the data type
string. In the following string example, the "CHAR" data type is followed
by parenthesis while the "DATA" data type is not followed by parentheses:
"CHAR( ) FOR BIT DATA".</p>
<p> The setting for the connection string keyword
GRAPHIC affects whether the driver returns graphic (DBCS) data types as supported
types or not.</p>
See <a href="typemapping.htm#typemapping">ODBC data types and how they correspond to DB2 UDB database types</a> for
more information.</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Set and retrieve
driver attributes</strong> <div class="note"><span class="notetitle">Note:</span> Refer to <a href="connstmtattr.htm#connstmtattr">Connection and statement attributes</a>
for details on driver-specific connection and statement attributes applicable
to the following APIs. </div>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetConnectAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Sets a connection option.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetConnectAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the value of a connection option.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetEnvAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Sets an environment option. </td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetEnvAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the value of an environment option. </td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetStmtAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Sets a statement option.</td>
<td valign="top" width="45%" headers="d0e54 ">The SQL_ATTR_PARAMSET_SIZE, SQL_ATTR_ROW_ARRAY_SIZE,
SQL_DESC_ARRAY_SIZE, and SQL_ROWSET_SIZE attributes support up to 32767 rows.
If working with LOB locator fields the driver restricts these values to 1
row at a time. LOB fields are handled as locators if the MAXFIELDLEN connection
string value is less than the LOB field size. <p>SELECT statements that contain
the FOR FETCH ONLY or FOR UPDATE clause override the current setting of SQL_ATTR_CONCURRENCY
attribute. An error is not returned during the SQLExecute or SQLExecDirect
if the SQL_ATTR_CONCURRENCY setting conflicts with the clause in the SQL statement.</p>
<p>The
following are not supported: </p>
<ul><li>SQL_ATTR_ASYNC_ENABLE </li>
<li>SQL_ATTR_RETRIEVE_DATA</li>
<li> SQL_ATTR_SIMULATE_CURSOR </li>
<li>SQL_ATTR_USE_BOOKMARKS </li>
<li>SQL_ATTR_FETCH_BOOKMARK_PTR</li>
<li>SQL_ATTR_KEYSET_SIZE</li>
</ul>
Setting SQL_ATTR_MAX_ROWS is supported, however, it only impacts performance
for static cursors. The full result set is still built with other cursor types
even if this option is set. Using the FETCH FIRST x ROWS ONLY clause in your
SQL query may work better since it reduces the amount of work the server does.This
API has been extended to also contain the cursor row count for the following
two result set types: <ul><li>stored procedure result sets</li>
<li>static cursor result sets</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetStmtAttr</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the value of a statement option.</td>
<td valign="top" width="45%" headers="d0e54 ">The following are not supported: <ul><li>SQL_ATTR_ASYNC_ENABLE </li>
<li>SQL_ATTR_RETRIEVE_DATA</li>
<li> SQL_ATTR_SIMULATE_CURSOR </li>
<li>SQL_ATTR_USE_BOOKMARKS </li>
<li>SQL_ATTR_FETCH_BOOKMARK_PTR</li>
</ul>
</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Set and retrieve
descriptor fields</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetDescField</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a piece of information from a descriptor.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetDescRec</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns several pieces of information from a descriptor.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLSetDescField</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Sets a descriptor field.</td>
<td valign="top" width="45%" headers="d0e54 ">Can not set descriptor fields for an IRD other than
SQL_DESC_ARRAY_STATUS_PTR and SQL_DESC_ROWS_PROCESSED_PTR. <p>Does not support
named parameters.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetDescRec</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Sets several options for a descriptor.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLCopyDesc</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Copies information from one descriptor to another descriptor.</td>
<td valign="top" width="45%" headers="d0e54 ">SQLCopyDesc does not support named parameters.</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Prepare SQL requests</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLPrepare</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Prepares an SQL statement for later processing.</td>
<td valign="top" width="45%" headers="d0e54 ">Packages are created the first time a SQL statement
is prepared for that Connection. This results in the first prepare taking
slightly longer to complete than it would normally take. If there are any
problems with a pre-existing package the first prepare may return an error
depending on the setting for the package as specified in the DSN setup GUI.
On the Package tab of the DSN setup GUI are default package settings. These
settings are used when package settings have not already been customized for
that application. Note, these are not global settings <p>By default, the
driver sends SQL statement text to the host in the EBCDIC CCSID associated
with your job. Set the UNICODESQL keyword equal 1 or equal 2, to enable the
driver to send SQL statement text to the host in Unicode. Note that when sending
Unicode SQL statements the driver generates a different package name to avoid
collisions with existing packages that contain EBCDIC SQL statements. Setting
the connection string keyword UNICODESQL allows an application to specify
Unicode data for literals in the SQL statement. </p>
<p>See <a href="rzaiksqlconsider.htm">SQL
Statement Considerations</a> for several SQL statements that are not recommended
to be prepared and executed.</p>
<p>For information on which escape sequences
and scalar functions the driver supports see <a href="escapescalar.htm#escapescalar">SQLPrepare and SQLNativeSQL escape sequences and scalar functions</a>.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLBindParameter</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Assigns storage for a parameter in an SQL statement.
See <a href="rzaikparmmarkers.htm#parmmarkers">Parameter markers</a> for additional
information.</td>
<td valign="top" width="45%" headers="d0e54 ">Data conversions are made directly from the C type
that is specified to the actual host parameter (column) data type. <p>The
SQL data type and column size that are specified are ignored.</p>
<p>Conversions
that involve character data convert directly from the client codepage to the
column CCSID.</p>
<p>The driver returns an error during the execution of the
SQL statement if SQL_DEFAULT_PARAM is specified for the Strlen_or_IndPtr parameter.</p>
<p>Default
parameters are not supported by the DB2<sup>®</sup> UDB database. The driver handles the
binding of a parameter with the SQL_DEFAULT_PARAM option by returning an error
with an SQLSTATE of 07S01 during the execution of the CALL statement.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetCursorName</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the cursor name associated with a statement
handle.</td>
<td valign="top" width="45%" headers="d0e54 ">The driver will upper case all cursor names without
double-quotes around the name.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetCursorName</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Specifies a cursor name. </td>
<td valign="top" width="45%" headers="d0e54 ">The cursor name is converted to capital letters
if it is not entered in quotes. Cursor names that are entered in quotes are
not converted. For example, <strong>myCursorName</strong> becomes <strong>MYCURSORNAME</strong> while <strong>"myCursorName"</strong> is
treated as <strong>myCursorName</strong>, with a length of 14 since the quotes are included
in the length. <p>The driver supports only these characters in cursor names:
<strong>"",a-z, A-Z, 0-9, or _</strong>. No error will be returned by SQLSetCursorName
if an invalid name is entered, however, an error will be returned later when
trying to use an invalid name. </p>
<p>The cursor name can only be 18 characters
long, including the leading and trailing double quotes if they exist, and
must be in characters that can be translated from UNICODE to ANSI. </p>
<p>If
an application wishes to use a DRDA<sup>®</sup> connection through ODBC then they
will have the following restrictions: </p>
<ul><li>Cursor name changes are not allowed during the DRDA connection.</li>
<li>Cursor names will be changed by the driver and should be checked via SQLGetCursorName
after the cursor is open. (after SQLExecute or SQLExecDirect).</li>
</ul>
</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Submit requests</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLExecute</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Runs a prepared statement.</td>
<td valign="top" width="45%" headers="d0e54 ">SQLExecute is affected by the settings of several
of the connection string keywords such as PREFETCH, CONNTYPE, CMT, and LAZYCLOSE.
Refer to <a href="connectkeywords.htm#connectkeywords">Connection string keywords</a> for descriptions
of these keywords.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLExecDirect</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Runs a statement.</td>
<td valign="top" width="45%" headers="d0e54 ">See SQLPrepare and SQLExecute.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLNativeSQL</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the text of an SQL statement as translated by
the driver.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLDescribeParam</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the description for a specific parameter in
a statement.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLNumParams</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the number of parameters in a statement.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLParamData</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the storage value assigned to a parameter for
which data will be sent at run time (useful for long data values).</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLPutData</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Send part or all of a data value for a parameter (useful
for long data values).</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Retrieve results
and related information</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLRowCount</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the number of rows that are affected by an insert,
update, or delete request.</td>
<td valign="top" width="45%" headers="d0e54 ">This API has been extended to also contain the cursor
row count for a result set using a static cursor to V5R1 or later server versions. </td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLNumResultCols</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the number of columns in the result set.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLDescribeCol</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Describes a column in the result set.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLColAttribute</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Describes attributes of a column in the result set.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLBindCol</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Assigns storage for a result column and specifies the
data type.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLExtendedFetch</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns rows in the result set. This is a supported
2.x ODBC API. However, new applications should use SQLFetchScroll API instead.</td>
<td valign="top" width="45%" headers="d0e54 ">Uses the value of the statement attribute SQL_ROWSET_SIZE
instead of SQL_ATTR_ROW_ARRAY_SIZE for the rowset size. <p>You can only use
SQLExtendedFetch in combination with SQLSetPos and SQLGetData if the row size
is 1. </p>
<p>SQL_FETCH_BOOKMARK is not supported.</p>
<p>The result set for
catalog APIs (such as SQLTables and SQLColumns) is forward only and read only.
When SQLExtendedFetch is used with result sets generated by catalog APIs,
no scrolling is allowed.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLFetch</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns rows in the result set. </td>
<td valign="top" width="45%" headers="d0e54 ">Can only be used with SQL_FETCH_FIRST and SQL_FETCH_NEXT
since the cursor is forward only.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLFetchScroll</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns rows in the result set. Can be used with scrollable
cursors. </td>
<td valign="top" width="45%" headers="d0e54 ">Does not support the fetch orientation of SQL_FETCH_BOOKMARK
because the driver does not support bookmarks.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetData</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns part or all of one column of one row of a result
set (useful for long data values). See <a href="rzaiksqlfetchgetdata.htm#sqlfetchgetdata">SQLFetch and SQLGetData</a> for
additional information.</td>
<td valign="top" width="45%" headers="d0e54 ">SQLGetData can only be used with single row fetches.
Errors are reported by SQLGetData if the row array size is larger than one. </td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSetPos</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Positions a cursor within a fetched block of data.</td>
<td valign="top" width="45%" headers="d0e54 ">SQL_UPDATE, SQL_DELETE, SQL_ADD are unsupported
options for Operations parameter. <p>SQL_LOCK_EXCLUSIVE, SQL_LOCK_UNLOCK
are unsupported options for the LockType parameter. </p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLBulkOperations</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Performs bulk insertions and bulk bookmark operations,
including update, delete, and fetch by bookmark. </td>
<td valign="top" width="45%" headers="d0e54 ">The driver does not support SQLBulkOperations.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLMoreResults</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Determines whether there are more result sets available
and if so, initializes processing for the next result set.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Byte</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetDiagField </td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a piece of diagnostic information.</td>
<td valign="top" width="45%" headers="d0e54 ">The SQL_DIAG_CURSOR_ROW_COUNT option is only accurate
for static cursors when running to V5R1 or later server versions.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLGetDiagRec</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns additional error or status information. </td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Get data source
system table information</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char </td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLColumnPrivileges</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a list of columns and associated privileges
for one or more tables.</td>
<td valign="top" width="45%" headers="d0e54 ">Returns an empty result set when: <ul><li>V5R1 or earlier servers or</li>
<li>V5R2 servers, when option 2 of the CATALOGOPTIONS connection string keyword
is not set</li>
</ul>
<p>By default, when accessing V5R2 servers, column privilege information
will be returned.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLColumns</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a list of information on columns in one or more
tables.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLForeignKeys </td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a list of column names that comprise foreign
keys, if they exist for a specified table.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLProcedureColumns</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the list of input and output parameters, as
well as the columns that make up the result set for the specified procedures.</td>
<td valign="top" width="45%" headers="d0e54 ">The driver does not return information about columns
that make up result sets generated by procedures. The driver only returns
information about the parameters to the procedures.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLProcedures</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the list of procedure names stored in a specific
data source.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLSpecialColumns</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Retrieves information about the optimal set of columns
that uniquely identifies a row in a specified table. It also retrieves information
about the columns that are automatically updated when any value in the row
is updated by a transaction.</td>
<td valign="top" width="45%" headers="d0e54 ">If called with the SQL_BEST_ROWID option, returns
all indexed columns of that table.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLStatistics</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Retrieves statistics about a single table and the list
of indexes that are associated with the table.</td>
<td valign="top" width="45%" headers="d0e54 ">Beginning with V5R4, you can define a derived key
index. When SQLStatistics is used to retrieve information about the index,
the COLUMN_NAME result set column returns the expression that represents the
derived key index. </td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLTables </td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a list of schemas, tables, or table types in
the data source.</td>
<td valign="top" width="45%" headers="d0e54 ">See <a href="rzaiksqltablesdesc.htm#sqltablesdesc">SQLTables Description</a></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLTablePrivileges</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns a list of tables and the privileges that are
associated with each table.</td>
<td valign="top" width="45%" headers="d0e54 ">Returns an empty result set when: <ul><li>V5R1 or earlier servers or</li>
<li>V5R2 servers, when option 2 of the CATALOGOPTIONS connection string keyword
is not set</li>
</ul>
<p>By default, when accessing V5R2 servers, tables privilege information
will be returned.</p>
</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">Char</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLPrimaryKeys</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Returns the list of column name or names that comprise
the primary key for a table.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Clean up a statement</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLFreeStmt</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Ends statement processing and closes the associated
cursor, and discards pending results.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLCloseCursor</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Closes a cursor that is open on the statement handle.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLCancel</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Cancels an SQL statement.</td>
<td valign="top" width="45%" headers="d0e54 ">Not all queries can be cancelled. This is recommended
only for long running queries. For more information, see <a href="handlinglongrunningqueries.htm#handlinglongrunningqueries">Handle long-running queries</a>.</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLEndTran</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Commits or rolls back a transaction.</td>
<td valign="top" width="45%" headers="d0e54 ">For information regarding commitment control, see <a href="rzaikcommitcontrol.htm">Commitment control considerations</a>.</td>
</tr>
<tr><td colspan="4" align="center" valign="top" headers="d0e48 d0e50 d0e52 d0e54 "><strong>Terminate a connection</strong></td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 "> SQLDisconnect</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Closes the connection.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
<tr><td valign="top" width="8.125%" headers="d0e48 ">N/A</td>
<td valign="top" width="21.25%" headers="d0e50 ">SQLFreeHandle</td>
<td valign="top" width="25.624999999999996%" headers="d0e52 ">Releases resources associated with handles.</td>
<td valign="top" width="45%" headers="d0e54 ">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzaiksqlconsider.htm">SQL Statement Considerations</a></strong><br />
Identify SQL statement functions that are accomplished using ODBC.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaikodbcapifunctions.htm" title="Learn about implementations issues when using ODBC APIs.">Implementation issues of ODBC APIs</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="rzaikodbcapilimits.dita" target="_blank">ODBC API restrictions and unsupported functions</a></div>
<div><a href="http://www.microsoft.com/">Microsoft Web site</a></div>
</div>
</div>
</body>
</html>