在.sql文件里写入:
set echo on;
select * from test2;
set trimspool off;
select * from test2;
set echo off;
prompt *** spool to sys_user.txt
spool c:/sys_user.txt;
set timing on;
set trimout on;
set colsep '|';
set heading off;
select * from test2;
spool off;
保存,然后在sqlplus里执行 @c:/xxx.sql
注意:以下情况说明sqlplus 没有用管理员权限打开