305 lines
17 KiB
HTML
305 lines
17 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 xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="dc.language" scheme="rfc1766" 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. -->
|
||
|
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<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="keywords" content="SQLTYPE field of SQLDA, SQLLEN field of SQLDA" />
|
||
|
<title>SQLTYPE and SQLLEN</title>
|
||
|
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="ic.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
|
||
|
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
|
||
|
|
||
|
|
||
|
<a name="sqltc"></a>
|
||
|
<h2 id="sqltc"><a href="rbafzmst02.htm#ToC_1502">SQLTYPE and SQLLEN</a></h2><a id="idx3455" name="idx3455"></a><a id="idx3456" name="idx3456"></a>
|
||
|
<p>The following table shows the values that may appear in the SQLTYPE and
|
||
|
SQLLEN fields of the SQLDA. In PREPARE and DESCRIBE, an even value of SQLTYPE
|
||
|
means the column does not allow nulls, and an odd value means the column does
|
||
|
allow nulls. </p>
|
||
|
<a name="wq2011"></a>
|
||
|
<div class="notetitle" id="wq2011">Note:</div>
|
||
|
<div class="notebody">In an SQLDA used in DESCRIBE or PREPARE statements,
|
||
|
an odd value is returned for an expression if one operand is nullable or if
|
||
|
the expression may result in a -2 mapping-error null value.</div><p class="indatacontent"> In
|
||
|
FETCH, OPEN, CALL, and EXECUTE, an even value of SQLTYPE means no indicator
|
||
|
variable is provided, and an odd value means that SQLIND contains the address
|
||
|
of an indicator variable.</p>
|
||
|
<a name="scatlen"></a>
|
||
|
<table id="scatlen" width="100%" summary="" border="1" frame="hsides" rules="rows">
|
||
|
<caption>Table 98. SQLTYPE and SQLLEN values for PREPARE, DESCRIBE, FETCH, OPEN, CALL, or EXECUTE</caption>
|
||
|
<thead valign="bottom">
|
||
|
<tr>
|
||
|
<th id="wq2012" width="20%" rowspan="2" align="left" valign="bottom">SQLTYPE</th>
|
||
|
<th id="wq2013" colspan="2" align="center" valign="bottom">For PREPARE
|
||
|
and DESCRIBE</th>
|
||
|
<th id="wq2014" colspan="2" align="center" valign="bottom">For FETCH,
|
||
|
OPEN, CALL, and EXECUTE</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th id="wq2015" width="20%" align="left" valign="bottom">COLUMN DATA TYPE</th>
|
||
|
<th id="wq2016" width="20%" align="left" valign="bottom">SQLLEN</th>
|
||
|
<th id="wq2017" width="20%" align="left" valign="bottom">HOST VARIABLE DATA TYPE</th>
|
||
|
<th id="wq2018" width="20%" align="left" valign="bottom">SQLLEN</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody valign="top">
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">384/385</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Date <sup class="fn"><a href="rbafzmstsqltc.htm#datelen">106</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">10</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length character-string representation
|
||
|
of a date</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">388/389</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Time</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">8</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length character-string representation
|
||
|
of a time</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">392/393</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Timestamp</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">26</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length character-string representation
|
||
|
of a time stamp</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">396/397</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">DataLink</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">DataLink</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">400/401</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">NUL-terminated graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">404/405</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">BLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">0 <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">BLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Not used. <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">408/409</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">CLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">0 <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">CLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Not used. <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">412/413</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">DBCLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">0 <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">DBCLOB</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Not used. <sup class="fn"><a href="rbafzmstsqltc.htm#longln">107</a></sup></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">448/449</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Varying-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Varying-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">452/453</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Fixed-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">456/457</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Long varying-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Long varying-length character string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">460/461</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">NUL-terminated character string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">464/465</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Varying-length graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Varying-length graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">468/469</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Fixed-length graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">472/473</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Long varying-length graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Long graphic string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">476/477</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">PASCAL L-string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">480/481</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Floating point</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">4 for single precision, 8 for double precision</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Floating point</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">4 for single precision, 8 for double precision</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">484/485</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Packed decimal</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Precision in byte 1; scale in byte 2</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Packed decimal</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Precision in byte 1; scale in byte 2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">488/489</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Zoned decimal</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Precision in byte 1; scale in byte 2</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Zoned decimal</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Precision in byte 1; scale in byte 2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">492/493</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Big integer</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">8 <sup class="fn"><a href="rbafzmstsqltc.htm#bmvos2">108</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Big integer</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">8</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">496/497</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Large integer</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">4 <sup class="fn"><a href="rbafzmstsqltc.htm#bmvos2">108</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Large integer</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">4</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">500/501</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Small integer</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">2 <sup class="fn"><a href="rbafzmstsqltc.htm#bmvos2">108</a></sup></td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Small integer</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">504/505</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">DISPLAY SIGN LEADING SEPARATE</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Precision in byte 1; scale in byte 2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">904/905</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">ROWID</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">40</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">ROWID</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">40</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">908/909</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Varying-length binary string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Varying-length binary string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">912/913</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Fixed-length binary string</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Length attribute of the column</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">Fixed-length binary string</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">Length attribute of the host variable</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">916/917</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">BLOB file reference variable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">267</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">920/921</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">CLOB file reference variable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">267</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">924/925</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">DBCLOB file reference variable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">267</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">960/961</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">BLOB locator</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">4</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">964/965</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">CLOB locator</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">4</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" valign="top" headers="wq2012">968/969</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2015">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2013 wq2016">Not Applicable</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2017">DBCLOB locator</td>
|
||
|
<td align="left" valign="top" headers="wq2014 wq2018">4</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<hr /><div class="fnnum"><a id="datelen" name="datelen">106</a>.</div>
|
||
|
<div class="fntext">Less for *JUL, *YMD, *DMY, and
|
||
|
*MDY formats. For more information, see <a href="rbafzmstch2data.htm#datstt1">Table 5</a></div><div class="fnnum"><a id="longln" name="longln">107</a>.</div>
|
||
|
<div class="fntext">Field SQLLONGLEN in the extended SQLVAR contains the length
|
||
|
attribute of the column.</div><div class="fnnum"><a id="bmvos2" name="bmvos2">108</a>.</div>
|
||
|
<div class="fntext">Binary numbers can be represented in the SQLDA with a length
|
||
|
of 2, 4, or 8, or with the precision in byte 1 and the scale in byte 2. If
|
||
|
the first byte is greater than x'00', it indicates precision and scale.</div>
|
||
|
<br />
|
||
|
<hr /><br />
|
||
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstsqlvaroc.htm">Previous Page</a> | <a href="rbafzmstsname.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
|
||
|
<a href="rbafzmstindex.htm#index">Index</a> ]
|
||
|
|
||
|
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
|
||
|
</body>
|
||
|
</html>
|