sqlany_get_column_info

Gets column information for the specified result set column.

Syntax
sqlany_get_column_info ( $stmt, $col_index )
Parameters
  • $stmt   A statement object that was executed by sqlany_execute or sqlany_execute_direct.

  • $col_index   The column number between 0 and sqlany_num_cols() - 1.

Returns

Returns a 9-element array of information describing a column in a result set. The first element contains 1 on success or 0 on failure. The array elements are described in the following table.

Element number Type Description
0 Integer 1 on success or 0 on failure.
1 Integer Column index (0 to sqlany_num_cols() - 1).
2 String Column name.
3 Integer Column type. See Column types.
4 Integer Column native type. See Native column types.
5 Integer Column precision (for numeric types).
6 Integer Column scale (for numeric types).
7 Integer Column size.
8 Integer Column nullable (1=nullable, 0=not nullable).
See also
Example
# Get column info for first column (0)
rc, col_num, col_name, col_type, col_native_type, col_precision, col_scale,
    col_size, col_nullable = api.sqlany_get_column_info( stmt, 0 )