ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzgetdescr.htm

940 lines
35 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="GET DESCRIPTOR statement, GET DESCRIPTOR,
SQL statements, in GET DESCRIPTOR statement, SQL-descriptor-name, COUNT,
DYNAMIC_FUNCTION, DYNAMIC_FUNCTION_CODE, KEY_TYPE, DB2_MAX_ITEMS,
DB2_BASE_CATALOG_NAME, DB2_BASE_COLUMN_NAME, DB2_BASE_SCHEMA_NAME,
DB2_BASE_TABLE_NAME, DB2_CCSID, DB2_COLUMN_CATALOG_NAME, DB2_COLUMN_GENERATED,
DB2_COLUMN_GENERATION_TYPE, DB2_COLUMN_NAME, DB2_COLUMN_SCHEMA_NAME,
DB2_COLUMN_TABLE_NAME, DB2_COLUMN_UPDATABILITY, DB2_CORRELATION_NAME, DB2_LABEL,
DB2_PARAMETER_NAME, DB2_SYSTEM_COLUMN_NAME, DATA, DATETIME_INTERVAL_CODE,
INDICATOR, KEY_MEMBER, LENGTH, LEVEL, NAME, NULLABLE, OCTET_LENGTH,
PARAMETER_MODE, PARAMETER_ORDINAL_POSITION, PARAMETER_SPECIFIC_CATALOG,
PARAMETER_SPECIFIC_NAME, PARAMETER_SPECIFIC_SCHEMA, PRECISION, RETURNED_LENGTH,
RETURNED_OCTET_LENGTH, SCALE, TYPE, UNNAMED, USER_DEFINED_TYPE_CATALOG,
USER_DEFINED_TYPE_CODE, USER_DEFINED_TYPE_NAME, USER_DEFINED_TYPE_SCHEMA,
SQL (Structured Query Language), description" />
<title>GET DESCRIPTOR</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="getdescr"></a>
<h2 id="getdescr"><a href="rbafzmst02.htm#ToC_1086">GET DESCRIPTOR</a></h2><a id="idx2616" name="idx2616"></a><a id="idx2617" name="idx2617"></a>
<p>The GET DESCRIPTOR statement gets information from an SQL descriptor.</p>
<a name="wq1515"></a>
<h3 id="wq1515"><a href="rbafzmst02.htm#ToC_1087">Invocation</a></h3>
<p>This statement can only be embedded in an application program,
SQL function, SQL procedure, or trigger. It cannot be issued interactively.
It is an executable statement that cannot be dynamically prepared. It must
not be specified in REXX.</p>
<a name="wq1516"></a>
<h3 id="wq1516"><a href="rbafzmst02.htm#ToC_1088">Authorization</a></h3>
<p>None required.</p>
<a name="wq1517"></a>
<h3 id="wq1517"><a href="rbafzmst02.htm#ToC_1089">Syntax</a></h3>
<a href="rbafzgetdescr.htm#syngetdescr"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
<a name="wq1518"></a>
<div class="fignone" id="wq1518">
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn342.htm"
border="0" /></span><a href="#skipsyn-341"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a> .-SQL-. .-LOCAL--.
>>-GET--+-----+--DESCRIPTOR--+--------+--<span class="italic">SQL-descriptor-name</span>---->
'-GLOBAL-'
.-,---------------.
V |
>--+---<span class="italic">get-header-info</span>-+----------------------------+---------->&lt;
| .-,-------------. |
| V | |
'-VALUE--+-<span class="italic">integer</span>----------+----<span class="italic">get-item-info</span>-+-'
'-<span class="italic">integer-variable</span>-'
</pre>
<a name="skipsyn-341" id="skipsyn-341"></a></div>
<a name="wq1519"></a>
<div class="fignone" id="wq1519">
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn343.htm"
border="0" /></span><a href="#skipsyn-342"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a>get-header-info:
|--<span class="italic">variable-1</span>--&nbsp;=&nbsp;--+-COUNT-----------------+-------------------|
+-DYNAMIC_FUNCTION------+
+-DYNAMIC_FUNCTION_CODE-+
+-KEY_TYPE--------------+
'-DB2_MAX_ITEMS---------'
get-item-info:
|--<span class="italic">variable-2</span>--&nbsp;=&nbsp;--+-DATA-----------------------+--------------|
+-DATETIME_INTERVAL_CODE-----+
+-DB2_BASE_CATALOG_NAME------+
+-DB2_BASE_COLUMN_NAME-------+
+-DB2_BASE_SCHEMA_NAME-------+
+-DB2_BASE_TABLE_NAME--------+
+-DB2_CCSID------------------+
+-DB2_COLUMN_CATALOG_NAME----+
+-DB2_COLUMN_GENERATED-------+
+-DB2_COLUMN_GENERATION_TYPE-+
+-DB2_COLUMN_NAME------------+
+-DB2_COLUMN_SCHEMA_NAME-----+
+-DB2_COLUMN_TABLE_NAME------+
+-DB2_COLUMN_UPDATABILITY----+
+-DB2_CORRELATION_NAME-------+
+-DB2_LABEL------------------+
+-DB2_PARAMETER_NAME---------+
+-DB2_SYSTEM_COLUMN_NAME-----+
+-INDICATOR------------------+
+-KEY_MEMBER-----------------+
+-LENGTH---------------------+
+-LEVEL----------------------+
+-NAME-----------------------+
+-NULLABLE-------------------+
+-OCTET_LENGTH---------------+
+-PARAMETER_MODE-------------+
+-PARAMETER_ORDINAL_POSITION-+
+-PARAMETER_SPECIFIC_CATALOG-+
+-PARAMETER_SPECIFIC_NAME----+
+-PARAMETER_SPECIFIC_SCHEMA--+
+-PRECISION------------------+
+-RETURNED_LENGTH------------+
+-RETURNED_OCTET_LENGTH------+
+-SCALE----------------------+
+-TYPE-----------------------+
+-UNNAMED--------------------+
+-USER_DEFINED_TYPE_CATALOG--+
+-USER_DEFINED_TYPE_CODE-----+
+-USER_DEFINED_TYPE_NAME-----+
'-USER_DEFINED_TYPE_SCHEMA---'
</pre>
<a name="skipsyn-342" id="skipsyn-342"></a></div>
<a name="syngetdescr"></a>
<h3 id="syngetdescr"><a href="rbafzmst02.htm#ToC_1090">Description</a></h3>
<dl class="parml">
<dt class="bold">LOCAL</dt>
<dd>Specifies the scope of the name of the descriptor to be local to program
invocation. The information is returned from the descriptor known in this
local scope.
</dd>
<dt class="bold">GLOBAL</dt>
<dd>Specifies the scope of the name of the descriptor to be global to the
SQL session. The information is returned from the descriptor known to any
program that executes using the same database connection.
</dd>
<dt class="bold"><var class="pv">SQL-descriptor-name</var></dt>
<dd>Names the SQL descriptor. The name must identify a descriptor that already
exists with the specified scope.<a id="idx2618" name="idx2618"></a>
</dd>
<dt class="bold"><var class="pv">get-header-info</var></dt>
<dd>Returns information about the prepared SQL statement and SQL descriptor.
</dd>
<dt class="bold">VALUE</dt>
<dd>Identifies the item number for which the specified information is retrieved.
If the value is greater than the value of COUNT (from the header information),
then no result is returned. If the item number is greater than the maximum
number of items allocated for the descriptor or the item number is less than
1, an error is returned.
<dl class="parml">
<dt class="bold"><var class="pv">integer</var></dt>
<dd>An integer constant in the range of 1 to the number of items in the
SQL descriptor.
</dd>
<dt class="bold"><var class="pv">integer-variable</var></dt>
<dd>Identifies a variable declared in the program in accordance
with the rules for declaring variables. The data type of the variable must
be SMALLINT, INTEGER, BIGINT, or DECIMAL or NUMERIC with a scale of zero.
The value of <var class="pv">integer-variable</var> must be in the range of 1 to the maximum
number of items in the SQL descriptor.
</dd>
</dl>
</dd>
<dt class="bold"><var class="pv">get-item-info</var></dt>
<dd>Returns information about a specific item in the SQL descriptor.
</dd>
</dl>
<a name="gethdrinfo"></a>
<h4 id="gethdrinfo"><span><var class="pv">get-header-info</var></span></h4>
<p></p>
<dl class="parml">
<dt class="bold"><var class="pv">variable&ndash;1</var></dt>
<dd>Identifies a variable declared in the program in accordance
with the rules for declaring variables, but must not be a file reference variable.
The data type of the variable must be compatible with the descriptor information
item as specified in <a href="rbafzgetdescr.htm#getdesctable">Table 56</a>. The variable is assigned
(using storage assignment rules) to the corresponding descriptor item. For
details on the assignment rules, see <a href="rbafzmstch2bas.htm#ch2bas">Assignments and comparisons</a>.
</dd>
<dt class="bold">COUNT</dt><a id="idx2619" name="idx2619"></a>
<dd>A count of the number of items in the descriptor.
</dd>
<dt class="bold">DYNAMIC_FUNCTION</dt><a id="idx2620" name="idx2620"></a>
<dd>The type of the prepared SQL statement as a character string. For information
on statement type, see <a href="rbafzmstgetdiag.htm#stmtstrcode">Table 59</a>.
</dd>
<dt class="bold">DYNAMIC_FUNCTION_CODE</dt><a id="idx2621" name="idx2621"></a>
<dd>The statement code representing the type of the prepared SQL statement.
For information on statement codes, see <a href="rbafzmstgetdiag.htm#stmtstrcode">Table 59</a>.
</dd>
<dt class="bold">KEY_TYPE</dt><a id="idx2622" name="idx2622"></a>
<dd>The type of key included in the select list. The possible values are:
<dl>
<dt class="bold">0</dt>
<dd>The descriptor is not describing the columns of a query or there are
no key columns referenced in the query, or there is no unique key.
</dd>
<dt class="bold">1</dt>
<dd>The select list includes all the columns of the primary key of the base
table referenced by the query.
</dd>
<dt class="bold">2</dt>
<dd>The table referenced by the query does not have a primary key but the
select list includes a set of columns that are defined as the preferred candidate
key. If there is more than one such preferred candidate key included in the
select list, the left-most preferred candidate key is used.
</dd>
</dl>
</dd>
<dt class="bold">DB2_MAX_ITEMS</dt><a id="idx2623" name="idx2623"></a>
<dd>Represents the value specified as the allocated maximum number of item
descriptors on the ALLOCATE DESCRIPTOR statement. If the WITH MAX clause was
not specified, the value is the default number of maximum items for the ALLOCATE
DESCRIPTOR statement.
</dd>
</dl>
<a name="getiteminfo"></a>
<h4 id="getiteminfo"><span><var class="pv">get-item-info</var></span></h4>
<p></p>
<dl class="parml">
<dt class="bold"><var class="pv">variable&ndash;2</var></dt>
<dd>Identifies a variable declared in the program in accordance
with the rules for declaring variables, but must not be a file reference variable.
The data type of the variable must be compatible with the descriptor information
item as specified in <a href="rbafzgetdescr.htm#getdesctable">Table 56</a>. The variable is assigned
(using storage assignment rules) to the corresponding descriptor item. For
details on the assignment rules, see <a href="rbafzmstch2bas.htm#ch2bas">Assignments and comparisons</a>.
<p>When getting the DATA item, in general the variable must have the same data
type, length, precision, scale, and CCSID as specified in <a href="rbafzgetdescr.htm#getdesctable">Table 56</a>.
For variable-length types, the variable length must not be less than the
LENGTH in the descriptor. For C nul-terminated types, the variable length
must be at least one greater than the LENGTH in the descriptor.</p>
</dd>
<dt class="bold">DB2_BASE_CATALOG_NAME</dt><a id="idx2624" name="idx2624"></a>
<dd>The server name of the base table for the column represented by the
item descriptor.
</dd>
<dt class="bold">DB2_BASE_COLUMN_NAME</dt><a id="idx2625" name="idx2625"></a>
<dd>The name of the column as defined in the base table referenced
in the described query, possibly indirectly through a view. If a column name
cannot be defined or is not applicable, this item will contain the empty string.
The name is returned as case sensitive and without delimiters.
</dd>
<dt class="bold">DB2_BASE_SCHEMA_NAME</dt><a id="idx2626" name="idx2626"></a>
<dd>The schema name of the base table for the column represented
by the item descriptor. If a schema name cannot be defined or is not applicable,
this item will contain the empty string. The name is returned as case sensitive
and without delimiters.
</dd>
<dt class="bold">DB2_BASE_TABLE_NAME</dt><a id="idx2627" name="idx2627"></a>
<dd>The table name of the underlying base table for the column
represented by the item descriptor. If a table name cannot be defined or is
not applicable, this item will contain the empty string. The name is returned
as case sensitive and without delimiters.
</dd>
<dt class="bold">DB2_CCSID</dt><a id="idx2628" name="idx2628"></a>
<dd>The CCSID of character or graphic data. Value is zero for
all types that are not based on character or graphic string types. Value is
65535 for binary types or character types with the FOR BIT DATA attribute.
</dd>
<dt class="bold">DB2_COLUMN_CATALOG_NAME</dt><a id="idx2629" name="idx2629"></a>
<dd>The server name of the referenced table or view for the column represented
by the item descriptor. If a column catalog name cannot be defined or is not
applicable, this item will contain the empty string.
</dd>
<dt class="bold">DB2_COLUMN_GENERATED</dt><a id="idx2630" name="idx2630"></a>
<dd>Indicates whether a column is generated. Possible values are:
<dl>
<dt class="bold">0</dt>
<dd>Not generated
</dd>
<dt class="bold">1</dt>
<dd>GENERATED ALWAYS
</dd>
<dt class="bold">2</dt>
<dd>GENERATED BY DEFAULT
</dd>
</dl>
</dd>
<dt class="bold">DB2_COLUMN_GENERATION_TYPE</dt><a id="idx2631" name="idx2631"></a>
<dd>Indicates how the column is generated. Possible values are:
<dl>
<dt class="bold">0</dt>
<dd>Not generated
</dd>
<dt class="bold">1</dt>
<dd>IDENTITY column
</dd>
<dt class="bold">2</dt>
<dd>ROWID column
</dd>
</dl>
</dd>
<dt class="bold">DB2_COLUMN_NAME </dt><a id="idx2632" name="idx2632"></a>
<dd>The name of the column as defined in the table or view referenced
in the described query. If a column name cannot be defined or is not applicable,
this item will contain the empty string. The name is returned as case sensitive
and without delimiters.
</dd>
<dt class="bold">DB2_COLUMN_SCHEMA_NAME </dt><a id="idx2633" name="idx2633"></a>
<dd>The schema name of the referenced table or view for the column
represented by the item descriptor. If a column schema name cannot be defined
or is not applicable, this item will contain the empty string. The name is
returned as case sensitive and without delimiters.
</dd>
<dt class="bold">DB2_COLUMN_TABLE_NAME</dt><a id="idx2634" name="idx2634"></a>
<dd>The table or view name of the referenced table or view for
the column represented by the item descriptor. If a column table name cannot
be defined or is not applicable, this item will contain the empty string.
The name is returned as case sensitive and without delimiters.
</dd>
<dt class="bold">DB2_COLUMN_UPDATABILITY</dt><a id="idx2635" name="idx2635"></a>
<dd>Indicates whether the column represented by the item descriptor is updatable.
Possible values are:
<dl>
<dt class="bold">0</dt>
<dd>Not updatable
</dd>
<dt class="bold">1</dt>
<dd>Updatable
</dd>
</dl>
</dd>
<dt class="bold"> DB2_CORRELATION_NAME</dt><a id="idx2636" name="idx2636"></a>
<dd>The empty string is always returned.
</dd>
<dt class="bold">DB2_LABEL</dt><a id="idx2637" name="idx2637"></a>
<dd>The label defined for the column. If there is no label for the column,
this item will contain the empty string.
</dd>
<dt class="bold">DB2_PARAMETER_NAME</dt><a id="idx2638" name="idx2638"></a>
<dd>The name of the parameter for the stored procedure. Only
returned for a CALL statement. The name is returned as case sensitive and
without delimiters.
</dd>
<dt class="bold">DB2_SYSTEM_COLUMN_NAME</dt><a id="idx2639" name="idx2639"></a>
<dd>The system name of the column. If a system name cannot be
defined or is not applicable, this item will contain blanks.
</dd>
<dt class="bold">DATA</dt><a id="idx2640" name="idx2640"></a>
<dd>The value for the data described by the item descriptor. If the value
of INDICATOR is negative, then the value of DATA is undefined and the INDICATOR <var class="pv">get-item-info</var> must also be specified in the same statement.
</dd>
<dt class="bold">DATETIME_INTERVAL_CODE</dt><a id="idx2641" name="idx2641"></a>
<dd>Codes that define the specific datetime data type.
<dl>
<dt class="bold">0</dt>
<dd>Descriptor item does not have TYPE value of 9.
</dd>
<dt class="bold">1</dt>
<dd>DATE
</dd>
<dt class="bold">2</dt>
<dd>TIME
</dd>
<dt class="bold">3</dt>
<dd>TIMESTAMP
</dd>
</dl>
</dd>
<dt class="bold">INDICATOR</dt><a id="idx2642" name="idx2642"></a>
<dd>The value for the indicator. A negative value is used when
the value returned in this descriptor item is the null value. A non-negative
value is used when the value returned in this descriptor item is given in
the DATA field.
</dd>
<dt class="bold">KEY_MEMBER</dt><a id="idx2643" name="idx2643"></a>
<dd>An indication of whether this column is part of a key.
<dl>
<dt class="bold">0</dt>
<dd>This column is not part of a key.
</dd>
<dt class="bold">1</dt>
<dd>This column is part of a unique key.
</dd>
<dt class="bold">2</dt>
<dd>This column by itself is a unique key.
</dd>
</dl>
</dd>
<dt class="bold">LENGTH</dt><a id="idx2644" name="idx2644"></a>
<dd>Returns the maximum length of the data. If the data type is a character
or graphic string type or a datetime type, the length represents the number
of characters (not bytes). If the data type is a binary string or any other
type, the length represents the number of bytes. For a description of data
type codes and lengths, see <a href="rbafzgetdescr.htm#datatypecode">Table 57</a>.
</dd>
<dt class="bold">LEVEL</dt><a id="idx2645" name="idx2645"></a>
<dd>The level of the item descriptor. The value is 0.
</dd>
<dt class="bold">NAME</dt><a id="idx2646" name="idx2646"></a>
<dd>The name associated with the select list column described
by the item descriptor. The name is returned as case sensitive and without
delimiters.
</dd>
<dt class="bold">NULLABLE</dt><a id="idx2647" name="idx2647"></a>
<dd>Indicates whether the column or parameter marker is nullable.
<dl>
<dt class="bold">0</dt>
<dd>The select list column or parameter marker cannot have a null value.
</dd>
<dt class="bold">1</dt>
<dd>The select list column or parameter marker can have a null value.
</dd>
</dl>
</dd>
<dt class="bold">OCTET_LENGTH </dt><a id="idx2648" name="idx2648"></a>
<dd>Returns the maximum length of the data in bytes for all types. For a
description of data type codes and lengths, see <a href="rbafzgetdescr.htm#datatypecode">Table 57</a>.
</dd>
<dt class="bold">PARAMETER_MODE</dt><a id="idx2649" name="idx2649"></a>
<dd>The mode of the parameter marker in a CALL statement.
<dl>
<dt class="bold">0</dt>
<dd>The descriptor is not associated with a CALL statement.
</dd>
<dt class="bold">1</dt>
<dd>Input only parameter.
</dd>
<dt class="bold">2</dt>
<dd>Input and output parameter.
</dd>
<dt class="bold">4</dt>
<dd>Output only parameter.
</dd>
</dl>
</dd>
<dt class="bold">PARAMETER_ORDINAL_POSITION</dt><a id="idx2650" name="idx2650"></a>
<dd>The ordinal position of the parameter marker in a CALL statement. The
value is 0 if the descriptor is not associated with a CALL statement.
</dd>
<dt class="bold">PARAMETER_SPECIFIC_CATALOG</dt><a id="idx2651" name="idx2651"></a>
<dd>The server name of the procedure containing the parameter marker.
</dd>
<dt class="bold">PARAMETER_SPECIFIC_NAME</dt><a id="idx2652" name="idx2652"></a>
<dd>The specific name of the procedure containing the parameter
marker. The name is returned as case sensitive and without delimiters.
</dd>
<dt class="bold">PARAMETER_SPECIFIC_SCHEMA</dt><a id="idx2653" name="idx2653"></a>
<dd>The schema name of the procedure containing the parameter
marker. The name is returned as case sensitive and without delimiters.
</dd>
<dt class="bold">PRECISION</dt><a id="idx2654" name="idx2654"></a>
<dd>Returns the precision for the data:
<dl>
<dt class="bold">SMALLINT</dt>
<dd>4
</dd>
<dt class="bold">INTEGER</dt>
<dd>9
</dd>
<dt class="bold">BIGINT</dt>
<dd>19
</dd>
<dt class="bold">NUMERIC and DECIMAL</dt>
<dd>Defined precision
</dd>
<dt class="bold">DOUBLE</dt>
<dd>53
</dd>
<dt class="bold">REAL</dt>
<dd>24
</dd>
<dt class="bold">TIME</dt>
<dd>0
</dd>
<dt class="bold">TIMESTAMP</dt>
<dd>6
</dd>
<dt class="bold">Other data types</dt>
<dd>0
</dd>
</dl>
</dd>
<dt class="bold">RETURNED_LENGTH</dt><a id="idx2655" name="idx2655"></a>
<dd>The returned length in characters for character string and graphic string
data types. The returned length in bytes for binary string data types.
</dd>
<dt class="bold">RETURNED_OCTET_LENGTH</dt><a id="idx2656" name="idx2656"></a>
<dd>The returned length in bytes for all string data types.
</dd>
<dt class="bold">SCALE</dt><a id="idx2657" name="idx2657"></a>
<dd>Returns the defined scale if the data type is DECIMAL or
NUMERIC. The scale is 0 for all other data types.
</dd>
<dt class="bold">TYPE</dt><a id="idx2658" name="idx2658"></a>
<dd>Returns a data type code representing the data type of the item. For
a description of the data type codes and lengths, see <a href="rbafzgetdescr.htm#datatypecode">Table 57</a>.
</dd>
<dt class="bold">UNNAMED</dt><a id="idx2659" name="idx2659"></a>
<dd>A value of 1 indicates that the NAME value is generated by
the database manager. Otherwise, the value is zero and NAME is the derived
name of the column in the select list.
</dd>
<dt class="bold">USER_DEFINED_TYPE_CATALOG</dt><a id="idx2660" name="idx2660"></a>
<dd>The server name of the user-defined type. If the type is not a user-defined
data type, this item contains the empty string.
</dd>
<dt class="bold">USER_DEFINED_TYPE_CODE</dt><a id="idx2661" name="idx2661"></a>
<dd>Indicates whether the type of the descriptor item is a user-defined
type.
<dl>
<dt class="bold">0</dt>
<dd>The descriptor item is not a user-defined type.
</dd>
<dt class="bold">1</dt>
<dd>The descriptor item is a user-defined type.
</dd>
</dl>
</dd>
<dt class="bold">USER_DEFINED_TYPE_NAME</dt><a id="idx2662" name="idx2662"></a>
<dd>The name of the user-defined data type. If the type is not
a user-defined data type, this item contains the empty string. The name is
returned as case sensitive and without delimiters.
</dd>
<dt class="bold">USER_DEFINED_TYPE_SCHEMA </dt><a id="idx2663" name="idx2663"></a>
<dd>The schema name of the user-defined data type. If the type
is not a user-defined data type, this item contains the empty string. The
name is returned as case sensitive and without delimiters.
</dd>
</dl>
<a name="wq1520"></a>
<h3 id="wq1520"><a href="rbafzmst02.htm#ToC_1093">Notes</a></h3>
<p><span class="bold">Data types for items:</span> The following table shows,
the SQL data type for each descriptor item. When a descriptor item is assigned
to a variable, the variable must be compatible with the data type of the diagnostic
item.</p>
<a name="getdesctable"></a>
<table id="getdesctable" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 56. Data Types for GET DESCRIPTOR Items</caption>
<thead valign="bottom">
<tr>
<th id="wq1521" width="66%" align="left" valign="bottom">Item Name</th>
<th id="wq1522" width="33%" align="left" valign="bottom">Data Type</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td colspan="2" align="center" valign="top" headers="wq1521 wq1522"><span class="bold">Header Information</span></td>
</tr>
<tr>
<td headers="wq1521">COUNT</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DYNAMIC_FUNCTION</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DYNAMIC_FUNCTION_CODE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">KEY_TYPE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_MAX_ITEMS</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" headers="wq1521 wq1522"><span class="bold">Item Information</span></td>
</tr>
<tr>
<td headers="wq1521">DATA</td>
<td headers="wq1522">Matches the data type specified by TYPE</td>
</tr>
<tr>
<td headers="wq1521">DATETIME_INTERVAL_CODE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_BASE_CATALOG_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_BASE_COLUMN_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_BASE_SCHEMA_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_BASE_TABLE_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_CCSID</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_CATALOG_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_GENERATED</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_GENERATION_TYPE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_SCHEMA_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_TABLE_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_COLUMN_UPDATABILITY</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">DB2_CORRELATION_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_LABEL</td>
<td headers="wq1522">VARCHAR(60)</td>
</tr>
<tr>
<td headers="wq1521">DB2_PARAMETER_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">DB2_SYSTEM_COLUMN_NAME</td>
<td headers="wq1522">CHAR(10)</td>
</tr>
<tr>
<td headers="wq1521">INDICATOR</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">KEY_MEMBER</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">LENGTH</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">LEVEL</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">NULLABLE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">OCTET_LENGTH</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">PARAMETER_MODE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">PARAMETER_ORDINAL_POSITION</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">PARAMETER_SPECIFIC_CATALOG</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">PARAMETER_SPECIFIC_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">PARAMETER_SPECIFIC_SCHEMA</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">PRECISION</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">RETURNED_LENGTH</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">RETURNED_OCTET_LENGTH</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">SCALE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">TYPE</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">UNNAMED</td>
<td headers="wq1522">INTEGER</td>
</tr>
<tr>
<td headers="wq1521">USER_DEFINED_TYPE_CATALOG</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">USER_DEFINED_TYPE_NAME</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">USER_DEFINED_TYPE_SCHEMA</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
<tr>
<td headers="wq1521">USER_DEFINED_TYPE_CODE</td>
<td headers="wq1522">VARCHAR(128)</td>
</tr>
</tbody>
</table>
<p><span class="bold">SQL data type codes and lengths:</span> The following table
represents the possible values for TYPE, LENGTH, OCTET_LENGTH, and DATETIME_INTERVAL_CODE
descriptor items.</p>
<p>The values in the following table are assigned by the ISO and ANSI SQL
Standard and may change as the standard evolves. Include <span class="italic">sqlscds</span> in the include source files in library QSYSINC should be used
when referencing these values.</p>
<a name="datatypecode"></a>
<table id="datatypecode" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 57. SQL Data Type Codes and Lengths</caption>
<thead valign="bottom">
<tr>
<th id="wq1523" width="45%" align="left" valign="bottom">Data Type</th>
<th id="wq1524" width="18%" align="left" valign="bottom">Data Type Code</th>
<th id="wq1525" width="18%" align="left">Length</th>
<th id="wq1526" width="18%" align="left">Octet Length</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq1523">BIGINT</td>
<td headers="wq1524">25</td>
<td headers="wq1525">8</td>
<td headers="wq1526">8</td>
</tr>
<tr>
<td headers="wq1523">BLOB(n)</td>
<td headers="wq1524">30</td>
<td headers="wq1525">n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">CHARACTER(n)</td>
<td headers="wq1524">1</td>
<td headers="wq1525">n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">VARCHAR(n)</td>
<td headers="wq1524">12</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">CLOB(n)</td>
<td headers="wq1524">40</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">DATALINK(n)</td>
<td headers="wq1524">70</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">DATE (DATETIME_INTERVAL_CODE = 1)</td>
<td headers="wq1524">9</td>
<td headers="wq1525">Length depends on date format</td>
<td headers="wq1526">Based on CCSID</td>
</tr>
<tr>
<td headers="wq1523">TIME (DATETIME_INTERVAL_CODE = 2)</td>
<td headers="wq1524">9</td>
<td headers="wq1525">Length depends on time format</td>
<td headers="wq1526">Based on CCSID</td>
</tr>
<tr>
<td headers="wq1523">TIMESTAMP (DATETIME_INTERVAL_CODE = 3)</td>
<td headers="wq1524">9</td>
<td headers="wq1525">26</td>
<td headers="wq1526">26 or 52 (based on CCSID)</td>
</tr>
<tr>
<td headers="wq1523">DBCLOB(n)</td>
<td headers="wq1524">-350</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">2*n</td>
</tr>
<tr>
<td headers="wq1523">BINARY(n)</td>
<td headers="wq1524">&ndash;2</td>
<td headers="wq1525">n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">VARBINARY(n)</td>
<td headers="wq1524">&ndash;3</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">DECIMAL</td>
<td headers="wq1524">3</td>
<td headers="wq1525">(precision/2)+1</td>
<td headers="wq1526">(precision/2)+1</td>
</tr>
<tr>
<td headers="wq1523">DOUBLE PRECISION</td>
<td headers="wq1524">8</td>
<td headers="wq1525">8</td>
<td headers="wq1526">8</td>
</tr>
<tr>
<td headers="wq1523">FLOAT</td>
<td headers="wq1524">6</td>
<td headers="wq1525">8</td>
<td headers="wq1526">8</td>
</tr>
<tr>
<td headers="wq1523">GRAPHIC(n)</td>
<td headers="wq1524">&ndash;95</td>
<td headers="wq1525">n</td>
<td headers="wq1526">2*n</td>
</tr>
<tr>
<td headers="wq1523">INTEGER</td>
<td headers="wq1524">4</td>
<td headers="wq1525">4</td>
<td headers="wq1526">4</td>
</tr>
<tr>
<td headers="wq1523">NUMERIC(n)</td>
<td headers="wq1524">2</td>
<td headers="wq1525">n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">ZONED DECIMAL(n)</td>
<td headers="wq1524">2</td>
<td headers="wq1525">n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">REAL</td>
<td headers="wq1524">7</td>
<td headers="wq1525">4</td>
<td headers="wq1526">4</td>
</tr>
<tr>
<td headers="wq1523">ROWID</td>
<td headers="wq1524">&ndash;904</td>
<td headers="wq1525">40</td>
<td headers="wq1526">40</td>
</tr>
<tr>
<td headers="wq1523">SMALLINT</td>
<td headers="wq1524">5</td>
<td headers="wq1525">2</td>
<td headers="wq1526">2</td>
</tr>
<tr>
<td headers="wq1523">VARGRAPHIC(n)</td>
<td headers="wq1524">&ndash;96</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">2*n</td>
</tr>
<tr>
<td headers="wq1523">C nul terminated GRAPHIC(n)</td>
<td headers="wq1524">&ndash;400&reg;</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">2*n</td>
</tr>
<tr>
<td headers="wq1523">C nul terminated CHARACTER(n)</td>
<td headers="wq1524">1</td>
<td headers="wq1525">&lt;=n</td>
<td headers="wq1526">n</td>
</tr>
<tr>
<td headers="wq1523">BLOB File Reference Variable</td>
<td headers="wq1524">&ndash;916</td>
<td headers="wq1525">267</td>
<td headers="wq1526">267</td>
</tr>
<tr>
<td headers="wq1523">CLOB File Reference Variable</td>
<td headers="wq1524">&ndash;920</td>
<td headers="wq1525">267</td>
<td headers="wq1526">267</td>
</tr>
<tr>
<td headers="wq1523">DBCLOB File Reference Variable</td>
<td headers="wq1524">&ndash;924</td>
<td headers="wq1525">267</td>
<td headers="wq1526">267</td>
</tr>
</tbody>
</table>
<a name="wq1527"></a>
<h3 id="wq1527"><a href="rbafzmst02.htm#ToC_1094">Example</a></h3>
<p><span class="italic">Example 1:</span>&nbsp; Retrieve from the descriptor 'NEWDA'
the number of descriptor items.</p>
<a name="reffch"></a>
<pre id="reffch" class="xmp"> EXEC SQL <span class="bold">GET DESCRIPTOR</span> 'NEWDA'
:numitems <span class="bold">= COUNT;</span>
</pre>
<p><span class="italic">Example 2:</span>&nbsp; Retrieve from the first item descriptor
of descriptor 'NEWDA' the data type and the octet length.</p>
<pre class="xmp"> <span class="bold">GET DESCRIPTOR</span> 'NEWDA'
<span class="bold">VALUE</span> 1 :dtype <span class="bold">= TYPE</span>,
:olength <span class="bold">= OCTET_LENGTH;</span></pre><a id="idx2664" name="idx2664"></a><a id="idx2665" name="idx2665"></a><a id="idx2666" name="idx2666"></a><a id="idx2667" name="idx2667"></a>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstfreeloc.htm">Previous Page</a> | <a href="rbafzmstgetdiag.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>