I am using sql developer to output a csv file using spool command.
It works fine in sql devleoper after I click run script, but in the output file, there are select statement in it, how to remove it:
my test script is :
set heading off
set feedback off
set newpage none
set echo off
set termout off
set verify off
set trimspool on
set pause off
set linesize 1000
set pagesize 0
Select 'Student_Number | Last_Name' From Dual;
student_number||'|'||last_name from students where ID in (53651,53773);
But the result is: how can I remove the select statement in the output file, thanks
> Select 'Student_Number | Last_Name' From Dual
Student_Number | Last_Name
student_number||'|'||last_name from students where ID in (53651,53773)
If you open the script file in a worksheet and run it using F5 (Run Script), the SQL statement appears in the output.
If you run the script file using @script the sql statement doesn't appear in the output.
This corresponds to sqlplus behaviour I think, where certain set options only apply to script files, not the current buffer.
Tested using SQL Developer 3.2.09. Older versions may behave differently.