返回首页

gbase数据、南大通用产品文档:GBase8sonmode 和 m 参数:切换到多用户模式(SQL 管理 API)

更新日期:2024年09月11日

.........................
- 764 -

SQLForeignKeys 返回外键列表。
SQLForeignKeys 返回以下任一一项:
l
指定表中外键列表(指定表中的指向其它表中主键的列)
l
其它表中引用指定表中主键的外键列表
驱动程序将返回每个列表作为在指定的 hstmt 上设置的结果。
下表描述了 SQLForeignKeys 的 SQLSTATE 和错误值。
SQLSTATE
错误值
错误消息
01000
-11001
General warning
08S01
-11020
Communication link failure
24000
-11031
Invalid cursor state
IM001
-11040
Driver does not support this function
S1000
-11060
General error
S1001
-11061
Memory allocation failure
S1008
-11065
Operation canceled
S1009
-11066
Invalid argument value
S1010
-11067
Function sequence error
S1090
-11071
Invalid string or buffer length

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 226 -

SQLSTATE
错误值
错误消息
S1C00
-11092
Driver not capable
S1T00
-11094
Timeout expired
S1C00
-11300
SQL_DEFAULT_PARAM not supported
08S01
-11301
A protocol error has been detected. Current connection is
closed.
S1000
-11310
Create and Drop must be executed within a ServerOnly
Connection
S1000
-11320
Syntax error
S1000
-11323
The statement contained an escape clause not supported by
this database driver

数据库服务器和应用程序都可以部分实现客户端函数。
可以使用 SQLPrepare() 和 SQLExecute() 或者使用 SQLExecDirect() 执行客户端函数。

调用 SQLExecute() 或 SQLExecDirect() 之前,需要调用 SQLBindParameter() 或
SQLBindCol() 绑定每个参数。
使用 SQLPrepare() 和 SQLExecute() 执行客户端函数
可以使用 SQLPrepare() 和 SQLExecute() 执行客户端函数。
要使用 SQLPrepare() 和 SQLExecute() 执行客户端函数:
1. 为客户端函数准备 SQL 语句。
2. 绑定参数。
3. 执行 SQL 语句。
下列代码示例说明了使用 ifx_lo_open()的这些步骤:
rc = SQLPrepare(hstmt, "{? = call ifx_lo_open(?, ?, ?)}", SQL_NTS);
rc = SQLBindParameter(...);

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 159 -
rc = SQLExecute(hstmt);

使用 SQLExecDirect() 执行客户端函数
可以使用 SQLExecDirect() 函数执行客户端函数。
要使用 SQLExecDirect() 执行客户端函数:
1. 绑定参数。
2. 执行 SQL 语句。
以下示例代码说明了使用 ifx_lo_open()的这些步骤:
rc = SQLBindParameter(...);
rc = SQLExecDirect(hstmt, "{? = call ifx_lo_open(?, ?, ?)}", SQL_NTS);