I\'m having a problem trying to run my sql script into oracle using sqlplus. The script just populates some dummy data:
DECLARE
role1Id NUMBER;
user1Id
The command line
sqlplus username/password@server/dbname @Setup.sql
mentioned above means that sqlplus
should execute the script Setup.sql
and wait further commands interactively (if script does not do exit
explicitly). This is a normal behavior of sqlplus
.
sqlplus
terminates in three cases:
WHENEVER
plsql-command)exit
(both interactive and sript)Either from interactive mode or from script you can send ^Z
character to softly terminate input flow. Interactively you just press Ctrl+Z,Enter
.
And, of course, you may redirect STDIN, and take it from file, not from keyboard. There are two similar ways to do this:
1) sqlplus username/password@server/dbname
In both cases sqlplus
will terminate after the script execution because of EOF
in the input flow.