I've got an SQL statement or a series of statements that I want to run more than once. Is there a way to put them in a file and then run them from inside sqlplus?
From the OS command prompt, navigate to the directory where the filename.sql file is stored.
Log into SQLPlus from the command line as the oracle user you wish to execute the statement.At the SQL> prompt, type the "@" symbol followed by the filename
The statements in the file will be run as if they had been typed in at the prompt directly.If you already logged into SQLPlus and wish to run an existing .sql file in a different directory, simply supply the directory path ending with the file: