在SQLPLUS里
set echo off
set feedback off
set heading off
set linesize 你想要的长度
set pagesize 一页的行数
spool c:\文件名
select col1||'|'||col2||'|'||col3||'|'||....
from   ur_table
where  ur_condition;
spool off

解决方案 »

  1.   

    set echo off
    set feedback off
    set heading off
    spool c:\文件名
    select * from marc_data
    spool off
    运行结果:
    SQL> select * from marc_data;0000000001           0                                                          
    00513nam0 2200217   450 00100110000000500170001101000200002810000410004810100080
    00891020007000971050018001041060006001222000040001282100031001682150022001993000
    013002216060012002346900019002467010017002657020013002820000000001200504121558
    00.0  a7111121538d108  a20050412d        ekmy0chiy0121    ea1 achi  aCN
      ay   z   000yy  ar1 aoracle 参考手册f发发发发著g方法译  a北京c机械 
    工业出版社d2003  a728页c插图d26cm  a不做描述  aoracle   atp211.138or
    v4 1a发发发发4著 0a方法4译                                              
                                                                                    
                                                                                    
                                                                                    
    SQL> spool off
    这个 SQL> select * from marc_data;
    SQL> spool off 还带着啊
    我只想要中间的内容部分
      

  2.   

    如何把保存的文件中的
    SQL> select * from marc_data;
    SQL> spool off 
    也去掉啊
      

  3.   

    你把那些语句保存到一个文件中去 test.sql
    set echo off
    set feedback off
    set heading off
    spool c:\文件名
    select * from marc_data
    spool off
    然后运行 
    SQL>@c:\test.sql
      

  4.   

    照楼上的作了
    显示,这是什么意思
    SQL> @c:\test.sql
      3
      

  5.   

    set echo off  
    set feedback off  取消数据回显
    set heading off  取消列标题
    set linesize num 你想要的长度
    set pagesize num 一页的行数
    spool c:\文件名
    select * from marc_data
    spool off
    SQL>@c:\test.sql 是运行脚本
      

  6.   

    为什么我运行 @c:test.sql
    就执行了?
    set echo off   不显示语句