How to Write a Spool Script in Oracle

How to Write a Spool Script in Oracle thumbnail
Oracle SQL*Plus Can Spool Results to a File

In Oracle SQL*Plus software, you can command the program to output its results to a file. This is called the "spool" command.

Things You'll Need

  • Microsoft Notepad
Show More

Instructions

    • 1

      Type (or copy and paste) the following lines into a Notepad file:

      spool c:\myfile1
      select * from emp;
      spool off
      exit

      Save this file as myscript.sql in c:\.

    • 2

      Type this line in another Notepad file:

      sqlplus me/myself@orclnew @c:\myscript.sql

      Save this Notepad file as mybatch.cmd in c:\.

    • 3

      Double-click on the mybatch.cmd in c:\, and you will see the spool output in c:\myfile1.lst.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured