Home » Infrastructure » Unix » can i use more than sql script in one shell script?
can i use more than sql script in one shell script? [message #98341] Wed, 28 July 2004 00:51 Go to next message
BhavinShah
Messages: 105
Registered: February 2004
Senior Member
hi.. friends,

I have a problem of running sql scripts in shell scripting programme..

example:
run_script.sh file:
sqlplus nmov/nmov @/non/a.sql @/non/b.sql @/non/c.sql
sqlplus fmov/fmov @/non/a.sql @/non/b.sql @/non/c.sql
eof

when i m executing run_script.sh only first script is executed and it don't go for @/nmov/b.sql
I have given exit in last @/non/c.sql file.

bye..
thax for help in adv.
Re: can i use more than sql script in one shell script? [message #98343 is a reply to message #98341] Wed, 28 July 2004 08:39 Go to previous messageGo to next message
Tak Tang
Messages: 142
Registered: May 2004
Senior Member
As far as I know, SQL*Plus accepts ONE script on the command line. Everything after the first script is passed as parameters (eg &1) to the script.

Takmeister
Re: can i use more than sql script in one shell script? [message #98344 is a reply to message #98341] Wed, 28 July 2004 09:43 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
you can use a "here document" or just a master.sql file:

sqlplus user/pass<b><<</b>EOF > t.log
@file1.sql
@file2.sql
exit
EOF


OR

sqlplus -s user/pass@db @master.sql

master.sql
==========
@@file1.sql
@@file2.sql
Previous Topic: UNIX installation on ordinary PC
Next Topic: Moving Database files
Goto Forum:
  


Current Time: Tue Apr 23 20:03:52 CDT 2024