Re: Running PL\SQL script from command line
Date: 1995/08/10
Message-ID: <40d30k$jee_at_mp.canuck.com>#1/1
tci_at_netcom.com (Jack Tolson) wrote:
->I am new to Oracle, and I am using SQLPLUS. Is there anyway to execute a *.sql script from
->the command line. Something like
->sqlplus -p filename.sql?
->Help please. Oracle must have something like this???????
I regularly use (from a shell script)
sqlplus -s user/pwd << _EOF_EOF_
(sqlplus commands)
exit
_EOF_EOF_
The "-s" for silent, suppresses signon messages, and the prompt.
I found that some versions of sqlplus did not properly recognize the
end-of-file, so including an explicit exit is safer.
To execute a script from a file, use the '_at_' character.
sqlplus -s user/pwd _at_script.sql
here the effect is as though the first command was an "_at_script.sql" The "_at_script.sql" behaves somewhat like "start script.sql" with some advantages: you can pass arguments to the script which are referenced as "&1", "&&2", etc.
-- Doug Henderson, Glen Coulee Consulting, Calgary, Alberta, Canada [Sent using Free Agent 1.0]Received on Thu Aug 10 1995 - 00:00:00 CEST