Skip to Main Content

Oracle Database Discussions

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!

Run a script from batch file

Saaz EnaMar 28 2012 — edited Dec 21 2012
Hi All,

I want to execute a SQL script that runs from a batch file.
Lets say, I have loader.bat file. This .bat file connects to Oracle and wants
to execute .sql file

The content of loader.bat file is
sqlplus 
@C:\temp_val_id.sql
At run time it ask to userid and password. I enter the username and password and then get connect to Oracle
But the temp_val_id.sql file is not exectuted.

The output is as below, but .sql file is not executed
C:\>sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter user-name: utest_tt_senayat/password@silver3

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
I am now trying a different method
sqlplus 
@@C:\temp_val_id.sql
The output is the same as above. Not executing temp_val_id.sql

Could someone please assist me,

Thanks in advance
Saaz
This post has been answered by Nikolay Ivankin on Mar 28 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2013
Added on Mar 28 2012
11 comments
42,280 views