declare v_cnt number;
begin
        select count(*) into v_cnt from dba_tab_columns where table_name='T_IDC_FUNCTION' and column_name='TEST1';
        if v_cnt = 0 then
          execute immediate 'alter table t_idc_function add test1 varchar(40)';  
          null;--IF语句里面必须至少一行SQL语句,所以当没有任何语句的时候,可以添加这一句
        end if;
end;

 

相关文章: