Oracle 存储过程的问题

declare tableExist number;
begin
Select count(1) into tableExist from all_tables where TABLE_NAME='WARNINGRECORD';
if tableExist>0 then
return;
end if;
execute immediate 'CREATE TABLE WarningRecord
(
RecordID varchar(36) PRIMARY KEY NOT NULL
)';

end;

    下面这句备注怎么能加到上面一起执行?
    COMMENT ON COLUMN WarningRecord.RecordID  IS '告警编号';

2个回答

嗯你再试试 或许能成功

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;
`


Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问