Cursors > Column and Parameter Descriptors Column and Parameter Descriptors
This section presents application and implementation descriptors as implemented by Rogue Wave DB Link. It is divided as follows:
Notion of Descriptors
CLI Definition
The CLI standard defines descriptors at implementation- and application- levels.
At implementation level —that is, from the database server point of view— the descriptors are called IRD (Implementation Row Descriptor) and IPD (Implementation Parameter Descriptor).
At application level, the descriptors are called ARD (Application Row Descriptor) and APD (Application Parameter Descriptor).
Likewise, Rogue Wave DB Link also differentiates between implementation level and application level, but refers to row descriptors as column descriptors and uses the same classes for column and parameter descriptors.
Implementation Within Rogue Wave DB Link
Rogue Wave DB Link uses two classes to describe the properties of a column or parameter:
IldDescriptor: Declared in the file
ildent.h, this class is used to describe a column or parameter type on the server side.
IldAppDescriptor: A subclass of
IldDescriptor declared in the file
ildtuple.h, this class is used to hold the type descriptor and the column or parameter values and indicators on the application side.
Implementation Descriptors
An instance of
IldDescriptor holds the following information about the column or parameter.
Table 4.2 shows the corresponding member functions:
IldDescriptor Member Functions
Use this Member Function | To get |
| Rogue Wave DB Link type |
| SQL data type code |
| Column name |
| Maximum data size (in bytes) |
IldDescriptor::getPrecision | Precision (for columns of a numeric type) - 0 if irrelevant |
| Scale (for columns of a numeric type) - 0 if irrelevant |
IldDescriptor::getSqlTypeName | SQL type name in the server |
| Nullability flag |
IldDescriptor::getADTDescriptor | Abstract type descriptor (for columns of Rogue Wave DB Link type) - null otherwise |
Note: Since most RDBMSs do not have the capability of describing the parameters of a query, the contents of the IldDescriptor object for a parameter are undefined until it is bound using the member function IldRequest::bindParam. |
Type Codes
SQL data type codes are defined as constants in the section Type Codes of the ildconst.h header file. Most of them have a name that is very similar to their CLI name but a few of them differ. The names are prefixed with IldSQL.
Their values are the ones defined in the CLI standard.
The CLI specification has been extended to negative values so as to provide support for all types of all supported RDBMSs.
Application Descriptors
An instance of
IldAppDescriptor adds the following information to its base class
IldDescriptor:
Member functions added by IldAppDescriptor to IldDescriptor
Information | Member Function |
Size of one element in the value buffer (in bytes) | |
Value buffer | |
Indicator buffer | |
In addition:
The member function
IldAppDescriptor::isExtValue lets you know whether the value buffer was allocated by Rogue Wave DB Link or is bound to some application memory space. This function returns
IlFalse in the first case or
IlTrue in the second.
The member function
IldAppDescriptor::isExtNulls lets you know whether the null-indicator buffer was allocated by Rogue Wave DB Link or is bound to some application memory space. This function returns
IlFalse in the first case or
IlTrue in the second.
Simple IldDescriptor objects exist only for user-defined data-type attribute descriptors of type IldADTDescriptor. All other accesses to descriptors return instances of derived classes:
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.