Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to run Oracle query using batch file?

User_HJS01Jan 26 2021

Hi All,
Please Note : I am executing ORACLE queries.
My apologies if this is a repeated question.
I am a beginner and trying to execute a simple select * query using batch file.
Here is my syntax:
sqlplus -s username/pass@servername @C:\Users\xxx\Desktop\OTHER\script1.sql
PAUSE
It throws the error -
image.pngHowever, I have modified the Oracle_Home variable but still getting the same error. Below is how I checked if Oracle_Home is set or not.
image.pngUnfortunately, this script does not do anything. Any help will be appreciated.

Comments
Post Details
Added on Jan 26 2021
8 comments
2,758 views