PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Detailed information about the columns
  • Tip: How to speed up the execution time of SQLColumn?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the characteristics of all the columns (or items):
  • for a given table.
  • for a given query.
Versions 16 and later
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
WEBDEV - Browser code SQLColumn only returns the characteristics of columns for a given query. A result must have been returned by the query to get the query characteristics.
New in version 16
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
WEBDEV - Browser code SQLColumn only returns the characteristics of columns for a given query. A result must have been returned by the query to get the query characteristics.
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
WEBDEV - Browser code SQLColumn only returns the characteristics of columns for a given query. A result must have been returned by the query to get the query characteristics.
Example
// 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
WEBDEV - Server codePHPAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Connectors (Native Accesses)

Columns of a given table Hide the details

<Result> = SQLColumn(<Connection Number> , <Table name> [, <Details>])
<Result>: Character string
Name of the table columns.
  • If <Details> is set to False, the character string contains the name of each table column separated by CR:
    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.
<Connection Number>: Integer
Number of the connection to use, returned by SQLConnect.
<Table name>: Character string (with quotes)
Name of the table whose columns are requested.
<Details>: Optional boolean
  • True (default option) for a detailed result,
  • False for a simplified result.

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.
Versions 16 and later
WEBDEV - Browser code Caution: The characteristics of the columns cannot be known if no result was returned by the query.
New in version 16
WEBDEV - Browser code Caution: The characteristics of the columns cannot be known if no result was returned by the query.
WEBDEV - Browser code Caution: The characteristics of the columns cannot be known if no result was returned by the query.
<Query name>: Character string
Name of the query (run by SQLExec or SQLExecWDR) whose columns are requested.
Versions 16 and later
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
New in version 16
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
<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 1Type 2ODBC type
    N1SQL_BIT: Bit
    N2SQL_TINYINT: Integer
    N3SQL_BIGINT: Long integer
    N4SQL_LONGVARBINARY: Binary Memo
    N5SQL_VARBINARY: Variable-length binary string
    N6SQL_BINARY: Binary
    T7SQL_LONGVARCHAR: ASCII string memo
    T9SQL_CHAR: Fixed-length string
    N10SQL_NUMERIC: Numeric
    N11SQL_DECIMAL: Decimal number
    N12SQL_INTEGER: Integer
    N13SQL_SMALLINT: Integer
    N14SQL_FLOAT: Double real
    N15SQL_REAL: Single real
    N16SQL_DOUBLE: Double real
    T17SQL_DATE: Date
    T18SQL_TIME: Time
    T19SQL_TIMESTAMP: Date time
    T20SQL_VARCHAR: Variable-length string
    T0SQL_WCHAR: Variable-length Unicode string
    T-2SQL_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.
Versions 16 and later
WEBDEV - Browser code In browser code:
  • Only two types are supported:
    Type 1Type 2ODBC type
    N16SQL_DOUBLE: Double real
    T0SQL_WCHAR: Variable-length Unicode string
  • the size is empty.
Reminder: The characteristics of the columns cannot be known if no result was returned by the query.
New in version 16
WEBDEV - Browser code In browser code:
  • Only two types are supported:
    Type 1Type 2ODBC type
    N16SQL_DOUBLE: Double real
    T0SQL_WCHAR: Variable-length Unicode string
  • the size is empty.
Reminder: The characteristics of the columns cannot be known if no result was returned by the query.
WEBDEV - Browser code In browser code:
  • Only two types are supported:
    Type 1Type 2ODBC type
    N16SQL_DOUBLE: Double real
    T0SQL_WCHAR: Variable-length Unicode string
  • the size is empty.
Reminder: The characteristics of the columns cannot be known if no result was returned by the query.
WEBDEV - Server codePHPAjax

Tip: How to speed up the execution time of SQLColumn?

The name of the table must be prefixed by the owner: the result will be nearly immediate:
SQLColumn(ConnectionNum, OWNER.CUSTOMER)
Component : wd250hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment