19.7.1 a_rdb_SQLColumnInfo_t structure (column information)
- Organization of this subsection
(1) Function
Information about the retrieval result columns acquired by a_rdb_SQLDescribeCols() is stored in a_rdb_SQLColumnInfo_t structures.
These structures are also used when a_rdb_SQLBindCols() is used to associate the retrieval result columns.
For details about a_rdb_SQLDescribeCols(), see 19.4.6 a_rdb_SQLDescribeCols() (acquire information about the retrieval result columns). For details about a_rdb_SQLBindCols(), see 19.4.3 a_rdb_SQLBindCols() (associate retrieval result columns).
(2) Format
typedef struct a_rdb_TG_ColumnInfo { struct a_rdb_TG_NameInfo *NameInfo ; /* Out */ struct a_rdb_TG_DataType *TypeInfo ; /* Out */ unsigned short Nullable ; /* Out */ char _ColumnInfo_rsv01[2] ; signed int StrLen_or_Ind ; /* Out */ void *TargetValue ; /* Out */ unsigned int BufferLength ; /* In */ char _ColumnInfo_rsv02[28] ; } a_rdb_SQLColumnInfo_t ;
(3) Members
- NameInfo
-
Specifies the address at which information about a column name of a retrieval result column is to be stored.
Specify this member if you execute a column description. If you execute a column bind, this member is ignored, if specified.
If a value of 0 is specified, this information is not acquired.
- TypeInfo
-
Specifies the address at which information about the data type of a retrieval result column is to be stored.
Specify this member if you execute a column description. If you execute a column bind, this member is ignored, if specified.
If a value of 0 is specified, this information is not acquired.
- Nullable
-
Returns a value indicating whether the null value can be returned in the retrieval result column.
-
The null value cannot be returned: a_rdb_SQL_IS_NOT_NULLABLE
-
The null value can be returned: a_rdb_SQL_IS_NULLABLE
This value is set when a column description is executed.
-
- StrLen_or_Ind
-
Acquires either a value length or an indicator value.
This value is set when a column description is executed.
- TargetValue
-
Specifies the address at which the value is to be stored. This value must be specified as a data description in C or C++ that corresponds to the SQL data type.
For details about the data descriptions in C or C++ that correspond to the SQL data types, see 19.6.2 Correspondences between SQL data types and data descriptions.
Specify this member if you execute a column bind. If you execute a column description, this member is ignored, if specified.
- BufferLength
-
Specifies the length of the area in which the value is to be stored.
For details about the data area length, see 19.6.2 Correspondences between SQL data types and data descriptions.
Specify this member if you execute a column bind. If you execute a column description, this member is ignored, if specified.
(4) Notes
When you use a a_rdb_SQLColumnInfo_t structure, make sure that you first initialize the area to all zeros, and then specify a value for each member to be used.