ITPub博客

首页 > Linux操作系统 > Linux操作系统 > exp 导出命令中tables表

exp 导出命令中tables表

原创 Linux操作系统 作者:sieper 时间:2010-01-22 16:10:55 0 删除 编辑

一个库中有上千张表,欲导出其中几个表之外的所有表。貌似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博客 ” ,链接:https://blog.itpub.net/11813230/viewspace-625796/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-03-17

  • 博文量
    87
  • 访问量
    210535