创建数据库表、添加注释的方法:

create table WARNINGRECORD
(
    RecordID varchar(36) primary key not null
);

comment on column WARNINGRECORD.RecordID is '告警编号';

现在想通过pl/sql语句块执行,代码如下:

declare tableExist number;
begin
    Select count(1) into tableExist from all_tables where TABLE_NAME='WARNINGRECORD';
    if tableExist>0 then
        execute immediate 'drop table WARNINGRECORD';
        return;
    end if;
    execute immediate 'CREATE TABLE WARNINGRECORD(RecordID varchar(36) PRIMARY KEY NOT NULL)';
    execute immediate 'COMMENT ON COLUMN WarningRecord.RecordID  IS ''告警编号''';
end;

 

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-12-05
  • 2022-01-05
相关资源
相似解决方案