一个库中有上千张表,欲导出其中几个表之外的所有表。貌似exp没这命令。那就写tables了,但是太多了,只能查user_tables;并多行合并。
写一个函数。
create or replace function col2row return clob is
text clob := '(';
name varchar2(32);
CURSOR cur IS
select table_name from user_tables;
begin
open cur;
fetch cur
into name;
while cur%found loop
text := text || name || ',';
fetch cur
into name;
end loop;
return text;
end col2row;
select col2row() from dual;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11813230/viewspace-625796/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11813230/viewspace-625796/