2.7. Scripts

You can always save the contents of the SQL*Plus buffer to a file for reuse—just type the SAVE command and a filename. If the file already exists, SQL*Plus tells you. You can do a “SAVE filename REPLACE,” which will replace the contents of an existing file. You also have the option to do a “SAVE filename APPEND,” which adds your SQL*Plus buffer statement to the end of the filename specified.

Where does the saved file go? In UNIX the save file goes into the directory from which you launched SQL*Plus. In Windows, it goes to the Oracle “bin” directory, but, if you set up a shortcut and changed the start-in directory, as recommended in Section 2.1, the file is saved to a dedicated directory. The following illustrates how we save a select ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.