sqlany_get_column_info Function

Gets column information for the specified result set column.

Syntax

sqlany_get_column_info ( $stmt, $col_index )

Parameters

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.
4 Integer Column native type.
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).

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 )