SQLBindCol 为结果集中的列分配存储和 GBase 8s ODBC Driver C 数据类型。
SQLBindCol 按如下方式分配存储:
l
一个存储缓冲区,用于接收一列数据的内容
l
存储缓冲区的长度
l
一个存储位置,用于接收访存操作返回的数据列的实际长度
GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 211 -
l
将 GBase 8s SQL 数据类型转换为 GBase 8s ODBC driver C 数据类型
下表描述了 SQLBindCol 的 SQLSTATE 和错误值。
SQLSTATE
错误值
错误消息
01000
-11001
General warning
S1000
-11060
General error
S1001
-11061
Memory-allocation failure
S1002
-11062
Invalid column number
S1003
-11063
Program type out of range
S1010
-11067
Function-sequence error
S1090
-11071
Invalid string or buffer length
S1C00
-11092
Driver not capable
重要: 应用程序可以调用 SQLBindCol 将列绑定到新的存储位置,而不管数据是否已经被存
取。新的绑定替换旧的绑定列以及其它绑定列。新的绑定不会应用到已经访存的数据;它会在
下次调用 SQLFetch 、SQLExtendedFetch 或 SQLSetPos 时发生作用。