Returns information about a regular column or a compute column in a result set, or a column in a cursor.
SqlColInfo% ( sqlhandle%, type%, column%, computeid%, columninfo )
where
type% | Description |
---|---|
SQLCI_REGULAR% | Return information about a regular column in the current result set. |
SQLCI_ALTERNATE% | Returns information about a compute column in the current result set. |
SQLCI_CURSOR% | Returns information about a column in the open cursor. |
The ColInfo structure is defined as follows:
Type ColInfo Name As String * 31 ActualName As String * 31 TableName As String * 31 CType As Integer UserType As Long MaxLength As Long Precision As Integer Scale As Integer VarLength As Integer Null As Integer CaseSensitive As Integer Updatable As Integer Identity As Integer End Type
The ColInfo fields (and the equivalent DB-Library functions, if any) are described below:
Field | Description |
---|---|
Name | Is the name of the returned column (SqlColName$). |
ActualName | Is the actual name of the column in TableName if type% is SQLCI_CURSOR%; otherwise, this is the same as Name. |
TableName | Is the table that contains the column if type% is SQLCI_CURSOR%; otherwise, an empty string. |
CType | Is the datatype of the column (SqlColType%, SqlAltType%). |
UserType | Is the user-defined datatype of the column (SqlColUType&, SqlAltUType&). |
MaxLength | Is the maximum length, in bytes, of the column (SqlColLen%, SqlAltLen%). |
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: SUCCEED (1) if the column is variable-length. FAIL (0) if the column is fixed-length. |
Null | Is one of the following: SUCCEED (1) if the column allows nulls. FAIL (0) if the column does not allow nulls. SQLUNKNOWN (2) if nullability is unknown. |
CaseSensitive | Is one of the following: SUCCEED (1) if the column is case sensitive. FAIL (0) if the column is case insensitive. SQLUNKNOWN (2) if case sensitivity is unknown. |
Updatable | Is one of the following: SUCCEED (1) if the column can be changed. FAIL (0) if the column is read-only and cannot be changed. SQLUNKNOWN (2) if updatability is unknown. |
Identity | Is one of the following: SUCCEED (1) if the column is an identity column. FAIL (0) if the column is not an identity column. |
succeed (1) or fail (0).
The SqlColInfo% function fills the supplied ColInfo structure with information about the specified column. Call this function after SqlResults% returns SUCCEED, or after SqlCursorOpen% returns a cursor handle.
SqlAltLen%, SqlAltType%, SqlAltUType&, SqlColLen%, SqlColName$, SqlColType%, SqlColUType&