|
|
|
|
- Detailed information about the columns
- Tip: How to speed up the execution time of SQLColumn?
SQLColumn (Function) In french: SQLColonne Returns the characteristics of all the columns (or items): - for a given table.
- for a given query.
// Connection to a database Connection_Number is int Connection_Number = SQLConnect(SourceName, "", "", "", "ODBC") i is int // LIST_TableList is a list containing the list of tables i = LIST_TableList IF i <> -1 THEN ListAdd(LIST_List1, SQLColumn(Connection_Number, LIST_TableList[i])) END
Syntax
Columns of a given query Hide the details
<Result> = SQLColumn(<Query name> [, <Details>])
<Result>: Character string - If <Details> is set to False, the character string contains the name of each table column separated by CR characters (Carriage Return):
Column1 + CR + Column2 + CR + ... + ColumnN - If <Details> is set to True, the character string contains the name of each table column along with various information about the column (name, type, size):
ColumnName + TAB + Type1 (N/T) + TAB + Type2 (number) + TAB + Size + CR This format is presented in the Remarks.
<Query name>: Character string Name of the query (executed with SQLExec or SQLExecWDR) for which we want to get the columns. <Details>: Optional boolean - True for a detailed result,
- False (default option) for a simple result.
Remarks Detailed information about the columns If <Details> is set to True, the character string contains the names of all the columns of a table along with some information about these columns (name, type, size) in the following format: Column_Name + TAB + Type 1 (N/T) + TAB + Type 2 (number) + TAB + Size - Type 1 (N/T): "N" for numeric column, "T" for text column
- Type 2: internal number indicating the exact type of the column (see the table)
| | | Type 1 | Type 2 | ODBC type |
---|
N | 1 | SQL_BIT: Bit | N | 2 | SQL_TINYINT: Integer | N | 3 | SQL_BIGINT: Long integer | N | 4 | SQL_LONGVARBINARY: Binary Memo | N | 5 | SQL_VARBINARY: Variable-length binary string | N | 6 | SQL_BINARY: Binary | T | 7 | SQL_LONGVARCHAR: ASCII string memo | T | 9 | SQL_CHAR: Fixed-length string | N | 10 | SQL_NUMERIC: Numeric | N | 11 | SQL_DECIMAL: Decimal number | N | 12 | SQL_INTEGER: Integer | N | 13 | SQL_SMALLINT: Integer | N | 14 | SQL_FLOAT: Double real | N | 15 | SQL_REAL: Single real | N | 16 | SQL_DOUBLE: Double real | T | 17 | SQL_DATE: Date | T | 18 | SQL_TIME: Time | T | 19 | SQL_TIMESTAMP: Date time | T | 20 | SQL_VARCHAR: Variable-length string | T | 0 | SQL_WCHAR: Variable-length Unicode string | T | -2 | SQL_WLONGVARCHAR: Unicode memo |
- Size: Displayable size of the column: size of the string for the character strings and size of the numeric value (in bytes) for the numeric values.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|