返回首页

gbase数据、南大通用产品文档:GBase8sGCILobWrite

更新日期:2024年09月11日



sword GCILobWrite2(
GCISvcCtx *svchp,
GCIError *errhp,
GCILobLocator *locp,
gbsub8 *byte_amtp,
gbsub8 *char_amtp,
gbsub8 offset,
void *bufp,
gbsub8 buflen,
ub1 piece,
void *ctxp,
GCICallbackLobWrite2 (cbfp)
(void *ctxp,
void *bufp,
oraub8 *lenp,
ub1 *piecep
void **changed_bufpp,
oraub8 *changed_lenp
),
ub2 csid,
ub1 csfrm
);

GBase 8s GCI 接口使用指南

南大通用数据技术股份有限公司 78
写入内容到一个大对象中,暂不支持大于4G的LOB对象。

参数
输入
/输出


svchp
输入/输出
上下文句柄指针
errhp
输入/输出
错误信息句柄,该接口调用失败时,错误信息会保存在错误句
柄中
locp
输入/输出
存储大对象描述符指针
byte_amtp
输入/输出
该参数为输入输出参数,当调用函数时,该参数表明想写入的字
节数,当函数执行完成后,GCI 会回填实际写入的字节数.对于
CLOB,仅在char_amtp 为零时使用
char_amtp
输入/输出
对于CLOB,该参数表示想读取的字节数,函数执行完以后,该参数
为实际读到的字节数
offset
输入
从大对象开始位置到当前位置的偏移量,以字节为单位
bufp
输入
存放要写的数据缓冲区指针
buflen
输入
bufp参数指向的缓冲区大小
piece
输入
正在写入缓冲区的哪一部分。此参数的默认值为
GCI_ONE_PIECE,表示将缓冲区写入单个块中。
对于分段或回调模式可以使GCI_FIRST_PIECE,
GCI_NEXT_PIECE,和GCI_LAST_PIECE
ctxp
输入
回调函数的参数,可以NULL
cbfp
输入
可以注册的回调函数,可以在逐段写入LOB 数据。如果是
NULL,则使用标准轮询方法。
回调函数必须返回GCI_CONTINUE 才能继续读取。如果返回
任何其他错误代码,则将终止LOB 写入。
回调采用以下参数:

ctxp(输入)
回调函数的参数。可以NULL。

bufp (输入/输出)
片段的缓冲区指针。

lenp (输入/输出)
缓冲区(输入)中数据的长度(以字节为单位)。

piecep(输出)
哪一块:GCI_NEXT_PIECE 或GCI_LAST_PIECE。

changed_bufpp(输出)
保留参数,目前不适用(仅用于和Oracle 调用保持兼容)

changed_lenp(输出)
保留参数,目前不适用(仅用于和Oracle 调用保持兼容)
csid
输入
保留参数,目前不适用(仅用于和Oracle调用保持兼容)
csfrm
输入
保留参数,目前不适用(仅用于和Oracle调用保持兼容)

如果执行成功,返回 GCI_SUCCESS,否则返回 GCI_ERROR。

本示例中,导出数据文件为oracle 的文本格式,同时设定字段分隔符为';'。
$ ./db2to8a -D'test' -u'db2inst1' -p'db2inst1' -q"select * from t1"
-m'3' -e';' -s'"' -n'NULL'
-f'data1.txt'
you machine is Little endian!
Connecting to test...
Connected to test.
--- unload [text file] mode ---
--- field=";" ---
0 rows exported at 2013-08-30 13:41:14
6 rows exported at 2013-08-30 13:41:14

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
574
output file t13.dat11 closed
export:
6 rows.
export:
4 columns.
export time:

以下SQL 功能和同构数据源一致,暂不支持:

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
612

不支持对dblink 表进行DDL 操作,如drop table,alter table 等操作;

不支持使用dblink 查询创建视图;

不支持使用dblink 表或查询作为update 的源关联更新本地表;

不支持merge 语句using 源部分使用dblink 查询;

不支持function 中使用dblink 查询。
示例
示例1
不支持对dblink 表进行DDL 操作,如drop table,alter table 等操作:
drop table x1@gc_dblink;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your GBase server version for the right syntax to use near '@gc_dblink'
at line 1
示例2
不支持对dblink 表进行update/delete/insert/merge 操作:
update x1@gc_dblink set id2 =1;
ERROR 1105 (HY000): DBLink-Table does not support update operation.
delete from x1@gc_dblink;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your GBase server version for the right syntax to use near '@gc_dblink' at line 1
示例3
不支持使用dblink 查询创建视图:
create view v1 as select * from t1@testlink;
ERROR 1235 (42000): This version of GBase doesn't yet support 'use dblink table in a
FUNCTION/TRIGGER/VIEW.'
示例4
不支持使用dblink 表或查询作为update 的源关联更新本地表
update t1,t1@o_link tt1 set t1.b=tt1.b where t1.a=tt1.a;
update t1 join t1@_link tt1 on t1.a=tt1.a set t1.b=tt1.b;
update t1 join (select a,b from t1@_link) tt1 on t1.a=tt1.a set t1.b=tt1.b;

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
613
ERROR 1105 (HY000): DBLink-Table does not support update operation.
示例5
不支持merge 语句using 源部分使用dblink 查询:
merge into x1 tt1 using (select * from x1@olink) tt on (tt1.id2=tt.id2)
when matched then update set tt1.id3=tt.id3
ERROR 1105 (HY000): DBLink-Table does not support update operation.
示例6
不支持function 中使用dblink 查询:
delimiter //
create function dfunc(id int) returns int
begin
declare fid int default 1;
set fid = (select id2 from x1@olink where id2=id limit 1);
return fid;
end //
This version of GBase doesn't yet support 'use dblink table in a FUNCTION/TRIGGER/VIEW.