文档首页 > > 工具指南> DSC SQL语法迁移工具> SQL语法迁移参考> Netezza语法迁移>

分享
更新时间:2020/08/05 GMT+08:00

分布键

DISTRIBUTE ON (column)迁移为DISTRIBUTE BY HASH (column)。

Netezza语法

迁移后语法

CREATE TABLE  N_AG_AMT_H
(
     AG_NO                national character varying(50)    not null,
     AG_CATEG_CD      national character varying(12)    not null,
     AMT_TYPE_CD      national character varying(12)    not null,
     DATA_START_DT   date                                      not null,
     CCY_CD               national character varying(3)     not null,
     DATA_END_DT      date
)
DISTRIBUTE ON (AG_NO, AG_CATEG_CD, AMT_TYPE_CD)
ORGANIZE   ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT)
;
CREATE TABLE  N_AG_AMT_H
(
     AG_NO                national character varying(50)    not null,
     AG_CATEG_CD      national character varying(12)    not null,
     AMT_TYPE_CD      national character varying(12)    not null,
     DATA_START_DT   date                                      not null,
     CCY_CD               national character varying(3)     not null,
     DATA_END_DT      date
) WITH(ORIENTATION=COLUMN)
DISTRIBUTE BY HASH (AG_NO, AG_CATEG_CD, AMT_TYPE_CD)
/* ORGANIZE   ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT) */
;

ORGANIZE ON

ORGANIZE ON需加注释。

Netezza语法

迁移后语法

CREATE TABLE  N_AG_AMT_H 
( 
     AG_NO               national character varying(50) not null, 
     AG_CATEG_CD     national character varying(12) not null, 
     AMT_TYPE_CD     national character varying(12) not null, 
     DATA_START_DT  date                                      not null, 
     CCY_CD              national character varying(3)     not null, 
     DATA_END_DT     date 
) 
DISTRIBUTE ON (AG_NO, AG_CATEG_CD, AMT_TYPE_CD) 
ORGANIZE ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT) 
;
CREATE TABLE  N_AG_AMT_H 
( 
     AG_NO                national character varying(50) not null, 
     AG_CATEG_CD      national character varying(12) not null, 
     AMT_TYPE_CD      national character varying(12) not null, 
     DATA_START_DT date                                      not null, 
     CCY_CD               national character varying(3)     not null, 
   DATA_END_DT      date 
) WITH(ORIENTATION=COLUMN) 
DISTRIBUTE BY HASH (AG_NO, AG_CATEG_CD, AMT_TYPE_CD) 
/* ORGANIZE ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT)*/
;

大字段类型

行存储支持BLOB 和CLOB。列存储不支持BLOB,仅支持CLOB。

Netezza语法

迁移后语法

CREATE TABLE  prod 
 ( 
      prod_no              number(6)      not null, 
      prod_name         national character varying(32)      not null, 
      prod_desc          clob, 
      prod_image        blob 
 ) 
 DISTRIBUTE ON (prod_no, prod_name) 
 ORGANIZE   ON (prod_no, prod_name) 
 ;
CREATE TABLE  prod 
 ( 
      prod_no              number(6)      not null, 
      prod_name         national character varying(32)      not null, 
      prod_desc          clob, 
      prod_image       bytea 
 ) WITH(ORIENTATION=COLUMN) 
 DISTRIBUTE BY HASH (prod_no, prod_name) 
 /* ORGANIZE   ON (prod_no, prod_name) */ 
 ;
分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

智能客服提问云社区提问