Oracle 脚本可重复执行
复制收展SQLdeclare
cnt integer;
begin
select count(0)
into cnt
from user_tab_columns a
where a.TABLE_NAME = upper('tableName')
and a.COLUMN_NAME = upper('columnName');
if cnt = 0 then
execute immediate 'alter table BI_DWSYZJ_HT add columnName varchar2(128)';
execute immediate 'comment on column BI_DWSYZJ_HT.columnName is ''字段描述''';
end if;
end;
/
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14