1ãå建æµè¯ç¨è¡¨teståtest1
create table test
(id int,
name varchar2(10));
create table test1
(id int,
name varchar2(10));
2ãè¦ä¸ºä¸¤ä¸ªè¡¨åæ¶å¢å id1åname1å段ã使ç¨ä»£ç ï¼
v_sql varchar2(2000);
v_table_name varchar2(30);
cursor c1 is select table_name from user_tables;
begin
open c1;
loop --æåä¸è¡æ°æ®å°c1
fetch c1 into v_table_name;
--å¤è¯»æ¯å¦æåå°å¼ï¼æ²¡åå°å¼å°±éåº
--åå°å¼c_job%notfound æ¯false
--åä¸å°å¼c_job%notfound æ¯true
exit when c1%notfound;
v_sql:='alter table '||v_table_name||' add id1 int';
execute immediate v_sql;
v_sql:='alter table '||v_table_name||' add name1 varchar2(10)';
execute immediate v_sql;
end loop;--å
³é游æ
close c1;
end;
温馨提示:内容为网友见解,仅供参考