Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere for Ruby » SQL Anywhere Ruby API

 

sqlany_get_column_info

获取指定结果集列的列信息。

语法
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 )