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

178 lines
11 KiB
HTML
Raw Permalink 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="SQLSetDescField - Set a descriptor field" />
<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="rzadpsetdesc" />
<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>SQLSetDescField - Set a descriptor field</title>
</head>
<body id="rzadpsetdesc"><a name="rzadpsetdesc"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLSetDescField - Set a descriptor field</h1>
<div><div class="section"></div>
<div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLSetDescField()</samp> sets
a field in a descriptor. <samp class="codeph">SQLSetDescField()</samp> is a more extensible
alternative to the <samp class="codeph">SQLSetDescRec()</samp> function.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLSetDescField (SQLHDESC hdesc,
SQLSMALLINT irec,
SQLSMALLINT fDescType,
SQLPOINTER rgbDesc,
SQLINTEGER bLen);</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. SQLSetDescField arguments</caption><thead align="left"><tr><th align="left" valign="top" width="20%" id="d0e51">Data type</th>
<th align="left" valign="top" width="20%" id="d0e53">Argument</th>
<th align="left" valign="top" width="20%" id="d0e55">Use</th>
<th align="left" valign="top" width="40%" id="d0e57">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="20%" headers="d0e51 ">SQLHDESC</td>
<td align="left" valign="top" width="20%" headers="d0e53 "><em>hdesc</em></td>
<td align="left" valign="top" width="20%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e57 ">Descriptor handle.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e51 ">SQLSMALLINT</td>
<td align="left" valign="top" width="20%" headers="d0e53 "><em>irec</em></td>
<td align="left" valign="top" width="20%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e57 ">Record number from which the specified field
is to be retrieved.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e51 ">SQLSMALLINT</td>
<td align="left" valign="top" width="20%" headers="d0e53 "><em>fDescType</em></td>
<td align="left" valign="top" width="20%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e57 ">See <a href="#rzadpsetdesc__tddtypp">Table 2</a>.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e51 ">SQLPOINTER</td>
<td align="left" valign="top" width="20%" headers="d0e53 "><em>rgbDesc</em></td>
<td align="left" valign="top" width="20%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e57 ">Pointer to buffer.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e51 ">SQLINTEGER</td>
<td align="left" valign="top" width="20%" headers="d0e53 "><em>bLen</em></td>
<td align="left" valign="top" width="20%" headers="d0e55 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e57 ">Length of descriptor buffer (<em>rgbDesc</em>).</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="rzadpsetdesc__tddtypp"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rzadpsetdesc__tddtypp" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. fDescType
descriptor types</caption><thead align="left"><tr><th align="left" valign="top" width="52.407407407407405%" id="d0e125">Descriptor</th>
<th align="left" valign="top" width="19.62962962962963%" id="d0e127">Type</th>
<th align="left" valign="top" width="27.962962962962962%" id="d0e129">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_COUNT</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SMALLINT</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the number of records in the descriptor. <em>irec</em> is
ignored.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_DATA_PTR</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SQLPOINTER</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the data pointer field for <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_DATETIME_INTERVAL_CODE</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SMALLINT</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the interval code for records with a
type of SQL_DATETIME</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_INDICATOR_PTR</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SQLPOINTER</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the indicator pointer field for <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_LENGTH_PTR</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SQLPOINTER</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the length pointer field for <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_LENGTH</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">INTEGER</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the length field of <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_PRECISION</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SMALLINT</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the precision field of <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_SCALE</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SMALLINT</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the scale field of <em>irec</em>.</td>
</tr>
<tr><td align="left" valign="top" width="52.407407407407405%" headers="d0e125 ">SQL_DESC_TYPE</td>
<td align="left" valign="top" width="19.62962962962963%" headers="d0e127 ">SMALLINT</td>
<td align="left" valign="top" width="27.962962962962962%" headers="d0e129 ">Set the type field of <em>irec</em>.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p>Instead of requiring an entire set of arguments
like <samp class="codeph">SQLSetDescRec()</samp>, <samp class="codeph">SQLSetDescField()</samp> specifies
which attribute you want to set for a specific descriptor record.</p>
<p>Although <samp class="codeph">SQLSetDescField()</samp> allows
for future extensions, it requires more calls to set the same information
than <samp class="codeph">SQLSetDescRec()</samp> for each descriptor record.</p>
</div>
<div class="section"><h4 class="sectiontitle">Return codes</h4><ul><li>SQL_SUCCESS</li>
<li>SQL_SUCCESS_WITH_INFO</li>
<li>SQL_ERROR</li>
<li>SQL_INVALID_HANDLE</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Diagnostics</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 3. SQLGetDescField SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e265">SQLSTATE</th>
<th align="left" valign="top" width="25%" id="d0e267">Description</th>
<th align="left" valign="top" width="50%" id="d0e269">Explanation</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e265 "><strong>HY</strong>009</td>
<td align="left" valign="top" width="25%" headers="d0e267 ">Argument value that is not valid</td>
<td align="left" valign="top" width="50%" headers="d0e269 ">The value specified for the argument <em>fDescType</em> or <em>irec</em> is
not valid. <p>The argument <em>rgbValue</em> is a null pointer.</p>
</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e265 "><strong>HY</strong>013 <strong>*</strong></td>
<td align="left" valign="top" width="25%" headers="d0e267 ">Memory management problem</td>
<td align="left" valign="top" width="50%" headers="d0e269 ">The driver is unable to access memory required
to support the processing or completion of the function.</td>
</tr>
<tr><td valign="top" width="25%" headers="d0e265 "><strong>HY</strong>021</td>
<td valign="top" width="25%" headers="d0e267 ">Internal descriptor that is not valid</td>
<td valign="top" width="50%" headers="d0e269 ">The internal descriptor cannot be addressed or allocated,
or it contains a value that is not valid.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">References</h4><ul><li><a href="rzadpfnbindc.htm#rzadpfnbindc">SQLBindCol - Bind a column to an application variable</a></li>
<li><a href="rzadpfndecol.htm#rzadpfndecol">SQLDescribeCol - Describe column attributes</a></li>
<li><a href="rzadpfnexecd.htm#rzadpfnexecd">SQLExecDirect - Execute a statement directly</a></li>
<li><a href="rzadpfnexec.htm#rzadpfnexec">SQLExecute - Execute a statement</a></li>
<li><a href="rzadpfnprep.htm#rzadpfnprep">SQLPrepare - Prepare a statement</a></li>
</ul>
</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>