Link to home
Start Free TrialLog in
Avatar of mruff
mruff

asked on

Execute Oracle Query via unix shell sql plus, query is in file

Hello experts
I want to execute a sql query from a shell script. I have the commands in my .sh script:
sqlplus user/pw@db
connnect user/ow@db
spool myres
->This all works well, now I want to execute a sql command which is in a file:
@myquery.sql
->I get SP2-0734: unknown command beginning "@myquery ..." rest of the line ignored

How can I in my script exectute a SQL query which is in a file?
SOLUTION
Avatar of Wasim Akram Shaik
Wasim Akram Shaik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial