declare
p_table_name varchar2(30);
p_column_name varchar2(30);
p_data_type varchar2(30);
p_cnt number;
p_sql varchar2(4000);
begin
p_table_name:='';
p_column_name:='';
select count(1) into p_cnt from user_tab_cols where a.table_name=p_table_name and a.column_name=p_column_name;
if p_cnt=0 then
p_sql:='alter table '||p_table_name||' add '||p_column_name||' '||p_data_type;
execute immediate p_sql;
end if;
end;
没测试,不过基本应该可以