Monday, May 18, 2015

SP2-0768: Illegal SPOOL command

SP2-0768: Illegal SPOOL command
Usage: SPOOL { | OFF | OUT }
where is file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]

This error came when you are trying to create log file from SQL* loader using SPOOL command.

This error came because of two reason
1. Wrong path for spool file
2. @*.sql file contain invalid characters


1. In my case i am trying to set spool file at path

spool C:\Users\******\Desktop\New folder\extract.log

It throws error because of "New folder" Folder name contain space
so Correct syntax to write the command either remove the space from folder name or enclosed the path in single quotes

2. If you are tring to execute the @*.sql file which contain the spool command can cause error
because some times in linux file contains
invalid characters like ^M

In that case you need to remove the invalid chars from file.


  1. It worked for the first time... however if i tried to give a different path next time it dose not work.


web stats