一.sql脚本格式
set trimspool on set timing off set linesize 1024 set echo off set term off set pagesize 50000 set verify off SET ARRAYSIZE 2000 SET COPYCOMMIT 30 prompt &&1 spool D:\&&1..txt; select to_char(sysdate,'yyyymmdd-hh24:mi:ss') from dual; @D:\1.sql param1 param2; select to_char(sysdate,'yyyymmdd-hh24:mi:ss') from dual; spool off; exit;
二.bat文件
start sqlplus username/pwd@sid @D:\test.sql param1 param2