oracle中有导出数据的sql脚本吗?可以写在存储过程里的。像“export to ……”这样的因为想在存储过程中写一个循环,变换导出条件导出多个txt。spool的话只能一个一个手工执行了。

解决方案 »

  1.   

    完成可以写成脚本,就象dos下面的.bat批处理命令一样,
    这样的脚在备份的时候经常会用到
      

  2.   

    是这样,因为我导出数据的条件要从其他表中select。比如:while (n < 10)
    loop
         select column2 into v_column from table1 where id = n 
         ......
         export to ***.txt of del select * fom table2 where condition = v_column ;
         n := n+1;
    end loop;;
      

  3.   

    -- SPOOL
    http://www.blogjava.net/cheneyfree/archive/2008/03/19/187342.html