Hello, I have written a stored procedure which compiles with the error message:

PL/SQL: ORA-00922: missing or invalid option

If I execute the script in Toad, it works. Below is the script

SET ECHO OFF
SET FEEDBACK OFF
SET SPACE 0
SET LINESIZE 2000
SET PAGESIZE 0
SET VERIFY OFF
SET HEADING ON
SET COLSEP |

spool 'C:\Output_to_flat_file.txt'

select * from T_TMP;
SPOOL OFF

any ideas?