Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run sql files in shell script

Status
Not open for further replies.

zircon06

Technical User
Jan 8, 2007
81
I'm running follwing script in shell scripts which is Test.sh after running I'M getting following error any idea

SQL> @table.sql
SP2-0310: unable to open file "table.sql"
SQL> prompt table.sql : OK
table.sql : OK
SQL> WHENEVER SQLERROR exit 2
SQL> @view.sql
SP2-0310: unable to open file "view.sql"
SQL> prompt view.sql : OK
view.sql : OK
SQL> WHENEVER SQLERROR exit 3
SQL> @procedure.sql
SP2-0310: unable to open file "procedure.sql"
SQL> prompt procedure.sql : OK
procedure.sql : OK
SQL> WHENEVER SQLERROR exit 4
SQL> @trigger.sql
SP2-0310: unable to open file "trigger.sql"
SQL> prompt trigger.sql : OK
trigger.sql : OK

MY sql are located in u01/app/oracle directory how to tell in script to look @table.sql in this location
 
Zircon,

(To produce the results that you show above, there is a "parent" script that you are running that you did not show being invoked, above.)

If you want Oracle's SQL*Plus to access the script names as they are now, you must invoke the SQL*Plus environment after having cd'd to the "/u01/app/oracle" path. So, from your o/s prompt, cd /u01/app/oracle, re-invoke your outermost/parent script, then post your findings/results here.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top