返回首页

gbase数据、南大通用产品文档:GBase8aSQL 功能不支持的场景

更新日期:2024年09月11日

以下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.

ifx_lo_specset_maxbytes() 函数设置智能大对象的最大大小。

语法
mint ifx_lo_specset_maxbytes(LO_spec, maxbytes)
ifx_lo_create_spec_t *LO_spec;

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 797 -
ifx_int8_t *maxbytes;
LO_spec
指向将最大大小保存在其中的 LO-specification 结构的指针。
maxbytes
指向包含智能大对象的最大数目的 ifx_int8_t 结构的指针。
如果此值为 -1,
则该智能
大对象没有大小限制。

用法
GBase 8s 不允许智能大对象的大小超过 maxbytes 值。数据库服务器不从
存储特征的继承层级取得该值。
要获取关于最大大小的更多信息,
请参阅 表 1。


返回代码
0
函数成功。
-1
函数不成功。

MERGE 语句允许您对源表与目标表的一个外部连接的结果应用布尔条件。如果 MERGE
语句包括 Update 子句,则对目标在 UPDATE 操作中使用那些满足您在 ON 关键字之后

GBase 8s SQL 指南:教程
南大通用数据技术股份有限公司 - 177 -

指定的连接条件的行。
MERGE 语句的 SET 子句支持与 UPDATE 语句的 SET 子句相同
的语法,并指定要更新的目标表的哪些列。
下例示例展示您可如何使用 MERGE 语句的 Update 子句来更新目标表:
MERGE INTO t_target AS t USING t_source AS s ON t.col_a = s.col_a
WHEN MATCHED THEN UPDATE
SET t.col_b = t.col_b + s.col_b ;
在前一示例中,目标表的名称为 t_target,源表的名称为 t_source。对于在源表与目标表中
其 col_a 都有相同的值的连接结果的行,MERGE 语句通过将源表中 col_b 列的值添加
到 t_target 表中 col_b 列的当前值来更新 t_target 表。
MERGE 语句的 UPDATE 操作不修改源表,且不可更新目标表中的任何行超过一次。
单个 MERGE 语句可同时组合 UPDATE 与 INSERT 操作,或可同时组合 DELETE 与
INSERT 操作而不需要删除子句。要了解不包括 Update 子句的 MERGE 的不同的示例,
请参阅主题 MERGE 的 Delete 子句