How to spool a file in SQL? What is the purpose of spooling a file?
I would like to know the correct method in spooling. I am new in SQL.
- Martyr2Lv 71 decade agoBest Answer
Well spooling isn't really inherent to SQL itself but more towards SQL products like Oracle's SQL Plus. Spooling takes the results of SQL commands and dumps it to an output device like a file or printer. The original ideal of spool was putting the data in a memory location queue so that a device can have access to it when it is finally ready... a print queue is a type of spool.
In SQL Plus the command is....
SQL>spool <filename> [mode]
Example would be...
SQL>....various SQL commands...
Using the mode (for things like appending)...
SQL>spool my_results.log APPEND;
SQL>....some more various SQL commands...
Hope this is the information you were looking for.