I tried duplicating the coils you get from sqlplus. I found the following and hope this helps:
Create your sql script file, i.e.:
Pay attention to the echo and serveroutput.
Test_Spool.SQL
Spool 'c:\temp\Test1.txt'; set echo on; set serveroutput on; declare sqlresult varchar2(60); begin select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') into sqlresult from dual; dbms_output.put_line('The date is ' || sqlresult); end; / Spool off; set serveroutput off; set echo off;
Run the script from another sheet:
@TEST_Spool.SQL
My conclusion from Test1.txt
set serveroutput on declare sqlresult varchar2(60); begin select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') into sqlresult from dual; dbms_output.put_line('The date is ' || sqlresult); end;
anonymous block completed
Date 2016-04-07 09:21:32
Coil
Jeff
source share