Spool Command in Oracle

Posted by Bubbly under Others category on | Views : 6571
Spool [pathdirectory]

Spool will record all your statements in a text file which will be created in the path specified by you in pathdirectory.

Until and unless you swtich off the spool it won't record your statements but a file will be created in that path.

For example, I write

SQL> spool C:\temp.txt (temp file will be created in C drive)
SQL> select * from tablename1 (Output will be generated)
SQL> select * from tablename2 (Output will be generated)
SQL> spool off (All records after your file was created will be recorded with errors/messages/outputs/results etc.)

You can try doing this using SQL * Plus Prompt

Comments or Responses

Login to post response