返回首页

gbase数据、南大通用产品文档:GBase8afunc_init()

更新日期:2024年09月11日

函数原型
my_bool func_init( UDF_INIT* initid, UDF_ARGS* args, char* message );
函数说明

检查传到func()的参数个数;

检查参数类型是否正确;

如果参数类型不正确,在func_init 中检查然后报错,或者在func_add
函数中自己转换;

指定返回结果的最大长度。对于string/decimal,这个值是返回值的最大字节

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
1403
数(decimal 时是显示数值,会包括正负号、小数点等)。返回类型为int、
real 类型时会忽略该值;

指定返回结果的最大小数位,主要针对decimal 和real;

指定结果属性为不含NULL,或者可以为NULL(create table as select 中列属
性会参照此值)。
参数说明

char *message
如果func_init 发生错误,
用户可以向message 拷贝错误信息,
同时函数返回1;

该函数是UDAF 的初始化函数,只在开始调用一次,它可用于参数校验,
设置输出结果属性等功能。如果func_init()返回一个错误,SQL 语句返回一
条错误消息,同时不会调用UDAF 后面的函数。


GBase 8a MPP Cluster 产品手册
目录
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
III

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