oracle中判断字段是否存在和添加表结构

declare cnt number;
begin
---查询要创建的表是否存在
select count(1)
into cnt
from cols
where table_name = upper('sys_CustomReport')
and column_name = upper('FConfig');

---如果存在则删除该表
if cnt<1 then
   execute immediate 'ALTER TABLE sys_CustomReport ADD FConfig Blob';
end if;
end;

原文地址:https://www.cnblogs.com/DKSoft/p/3068829.html