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;

posted @ 2013-05-09 13:46  D10.天地弦  阅读(442)  评论(0编辑  收藏  举报