Returns information about a regular column or a compute column in a result set, or a column in a cursor.
RETCODE dbcolinfo (
PDBHANDLE pdbhandle,
INT type,
DBINT column,
DBINT computeid,
LPDBCOL lpdbcol );
type | Description |
---|---|
CI_REGULAR | Returns information about a regular column in the current result set. |
CI_ALTERNATE | Returns information about a compute column in the current result set. |
CI_CURSOR | Returns information about a column in the open cursor. |
The DBCOL structure is defined as follows:
typedef struct
{
DBINT SizeOfStruct;
CHAR Name[MAXCOLNAMELEN+1]
CHAR ActualName[MAXCOLNAMELEN+1]
CHAR TableName[MAXTABLENAME+1]
SHORT Type;
DBINT UserType;
DBINT MaxLength;
BYTE Precision;
BYTE Scale;
BOOL VarLength;
BYTE Null;
BYTE CaseSensitive;
BYTE Updatable;
BOOL Identity;
} DBCOL, PTR LPDBCOL;
The DBCOL fields (and the equivalent DB-Library functions, if any) are described here:
Field | Description |
---|---|
SizeOfStruct | Before calling dbcolinfo, set this field equal to the value returned by the C sizeof function for the DBCOL structure. |
Name | Is the name of the returned column (dbcolname). |
ActualName | Is the actual name of the column in TableName if type is CI_CURSOR; otherwise, this is the same as Name. |
TableName | Is the table that contains the column if type is CI_CURSOR; otherwise, NULL. |
Type | Is the data type of the column (dbcoltype, dbalttype). |
UserType | Is the user-defined data type of the column (dbcolutype, dbaltutype). |
MaxLength | Is the maximum length, in bytes, of the column (dbcollen, dbaltlen). |
Precision | The precision if Type is SQLDECIMAL or SQLNUMERIC; otherwise, - 1. |
Scale | The scale if Type is SQLDECIMAL or SQLNUMERIC; otherwise, - 1. |
VarLength | Is one of the following (dbvarylen):
TRUE if the column is variable length. FALSE if the column is fixed length. |
Null | Is one of the following:
TRUE if the column allows nulls. FALSE if the column does not allow nulls. DBUNKNOWN if nullability is unknown. |
CaseSensitive | Is one of the following:
TRUE if the column is case-sensitive. FALSE if the column is case-insensitive. DBUNKNOWN if case sensitivity is unknown. |
Updatable | Is one of the following:
TRUE if the column can be changed. FALSE if the column is read-only and cannot be changed. DBUNKNOWN if updatability is unknown. |
Identity | Is one of the following:
TRUE if the column is an identity column. FALSE if the column is not an identity column. |
SUCCEED or FAIL.
Before calling dbcolinfo, set the SizeOfStruct field equal to the value returned by the C sizeof function for the DBCOL structure. The dbcolinfo function fills the supplied DBCOL structure with information about the specified column.
Call this function after dbresults returns SUCCEED, or after dbcursoropen returns a cursor handle.
dbaltlen | dbcolname |
dbalttype | dbcoltype |
dbaltutype | dbcolutype |
dbcollen | dbvarylen |