4D v16

ODBC_SQLDescribeCol

Home

 
4D v16
ODBC_SQLDescribeCol

ODBC_SQLDescribeCol 


 

ODBC_SQLDescribeCol ( stmtID ; colNb ; SpalteName ; Datentyp ; colSize ; decimalDigits ; nullable ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
stmtID  Lange Ganzzahl in Statement ID
colNb  Lange Ganzzahl in Column number of result data
SpalteName  String in Column name
Datentyp  Lange Ganzzahl in Data type of the column
colSize  Lange Ganzzahl in Size of the column
decimalDigits  Lange Ganzzahl in Number of decimal digits of the column
nullable  Lange Ganzzahl in Indicates if the column allows NULL values
Funktionsergebnis  Lange Ganzzahl in Returns the result of the MS ODBC API function SQLDescribeCol

The ODBC_SQLDescribeCol command returns the result descriptor, such as column name, type, column size, decimal digits, and nullability, for one column in the result set.

stmtID is a valid statement ID returned by ODBC_SQLAllocStmt.

colNb is the column number containing the result data.

colName is the name of the column.

dataType can be one of the following values:

ConstantSQL Data Type
SQL_CHAR CHAR
SQL_VARCHAR VARCHAR
SQL_LONGVARCHAR LONG VARCHAR
SQL_DECIMAL DECIMAL
SQL_NUMERIC NUMERIC
SQL_SMALLINT SMALLINT
SQL_INTEGER INTEGER
SQL_REAL REAL
SQL_FLOAT FLOAT
SQL_DOUBLE DOUBLE PRECISION
SQL_BIT BIT
SQL_TINYINT TINYINT
SQL_BIGINT BIGINT
SQL_BINARY BINARY
SQL_VARBINARY VARBINARY
SQL_LONGVARBINARY LONG VARBINARY
SQL_TYPE_DATEDate
SQL_TYPE_TIME Time
SQL_TYPE_TIMESTAMP TIMESTAMP
SQL_INTERVAL_MONTH INTERVAL MONTH
SQL_INTERVAL_YEAR INTERVAL YEAR
SQL_INTERVAL_YEAR_TO_MONTH INTERVAL YEAR TO MONTH
SQL_INTERVAL_DAY INTERVAL DAY
SQL_INTERVAL_HOUR INTERVAL HOUR
SQL_INTERVAL_MINUTE INTERVAL MINUTE
SQL_INTERVAL_SECOND INTERVAL SECOND
SQL_INTERVAL_DAY_TO_HOUR INTERVAL DAY TO HOUR
SQL_INTERVAL_DAY_TO_MINUTE INTERVAL DAY TO MINUTE
SQL_INTERVAL_DAY_TO_SECOND INTERVAL DAY TO SECOND
SQL_INTERVAL_HOUR_TO_MINUTE INTERVAL HOUR TO MINUTE
SQL_INTERVAL_HOUR_TO_SECOND INTERVAL HOUR TO SECOND
SQL_INTERVAL_MINUTE_TO_SECOND INTERVAL MINUTE TO SECOND

colSize is the size of the column.

decimalDigits is the number of decimal digits of the column.

nullable indicates if the column allows NULL values and can have one of the following values:

ConstantDescription
SQL_NO_NULLSDoes not allow NULL values
SQL_NULLABLEAllows NULL values
SQL_NULLABLE_UNKNOWNDriver cannot determine if the parameter allows NULL values

For more information, please see the SQLDescribeCol function in the MS ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms716289(VS.85).aspx.

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.

The following method returns the name of the third column in the Employee table:

 $result:=ODBC_SQLPrepare($statementID;"SELECT * FROM Employee")
 $result:=ODBC_SQLDescribeCol($statementID;3;vColumnName;vDataType;vcolSize;vDecimalDigits;vNullable)

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: ODBC_Results
Nummer: 16961

 
GESCHICHTE 

Erstellt: 4D ODBC Pro 2004

 
ARTIKELVERWENDUNG

4D ODBC Pro ( 4D v16)