Oracle 数据库操作
时间:2011-03-01 来源:小さいです哥
declare
cursor cur1 is select table_name from dba_tables@DATABASE_LINK_PERSON where owner='XYADMIN';
begin
for cur2 in cur1 loop
--execute immediate 'drop table XYADMIN.'||cur2.table_name;
execute immediate 'create table XYADMIN.'||cur2.table_name||' as select * from mailto:'%7C%7Ccur2.table_name%7C%7C'@DATABASE_LINK_PERSON';
end loop;
end;
// 删除数据库所有表
declare
cursor cur1 is select table_name from dba_tables where owner='XYADMIN';
begin
for cur2 in cur1 loop
execute immediate 'drop table XYADMIN.'||cur2.table_name;
end loop;
end;
declare
cursor cur1 is select table_name from dba_tables where owner='XYADMIN';
begin
for cur2 in cur1 loop
execute immediate 'delete XYADMIN.'||cur2.table_name;
end loop;
end;