更新时间:2024-11-15 GMT+08:00

COMMENT语句

COMMENT语句的迁移过程如下所示,输入一个复杂语句,迁移之后语句更加简化。

输入

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
CREATE MULTISET TABLE PDAT.t_tbl_comment
    (
        Data_Dt  DATE           NOT NULL
       ,Data_Src  VARCHAR(4)   NOT NULL
       ,List_Make_Stat  CHAR(1)  
    ) PRIMARY INDEX(Data_Dt,Data_Src) ;
COMMENT ON PDAT.t_tbl_comment IS 'comment test on table';
---------------
REPLACE VIEW  PVW.v_vw_comment AS
LOCKING ROW FOR ACCESS
SELECT Data_Dt, Data_Src, List_Make_Stat       
FROM PDAT.t_tbl_comment;
COMMENT ON PVW.v_vw_comment IS 'comment test on view';
COMMENT ON PVW.v_vw_comment.Data_Dt IS 'comment test on view column';

输出

COMMENT ON TABLE PDAT.t_tbl_comment IS 'comment test on table';
COMMENT ON VIEW PVW.v_vw_comment IS 'comment test on view';
COMMENT ON COLUMN PVW.v_vw_comment.Data_Dt IS 'comment test on view column';