获取指定结果集列的列信息。
sqlany_get_column_info ( $stmt, $col_index )
$stmt 由 sqlany_execute 或 sqlany_execute_direct 执行的语句对象。
$col_index 列编号在 0 到 sqlany_num_cols() - 1 之间。
返回 9 个元素的数组,其中包含用于描述结果集中一列的信息。第一个元素包含 1(成功时)或 0(失败时)。数组元素在下表中进行介绍。
元素号 | 类型 | 说明 |
---|---|---|
0 | Integer | 成功则为 1,失败则为 0。 |
1 | Integer | 列索引(0 到 sqlany_num_cols() - 1)。 |
2 | String | 列名。 |
3 | Integer | 列类型。请参见列类型。 |
4 | Integer | 列本地类型。请参见本地列类型。 |
5 | Integer | 列精度(用于数字类型)。 |
6 | Integer | 列小数位数(用于数字类型)。 |
7 | Integer | 列大小。 |
8 | Integer | 列可为空(1 = 可为空,0 = 不可为空)。 |
# 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 ) |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |