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!

Batch file to connect Sql*plus

717309Aug 14 2009 — edited Aug 14 2009
Hi,

I need to write a batch file that would accept parameters & then it should login to Oracle & execute a script.


So far, I have written the following lines in my batch file,

@echo off
set user=%1
set pass=%2
set Tnsname=%3
sqlplus %user%/%pass%@%Tnsname% @Test1.sql
exit

But, I have to prompt a msg like : Enter Username, Enter Password & Enter Tns name, if there is any error it should prompt corresponding error msg & should not connect to Sqlplus & it has to connect only if all the credentials are correct.

can some one help me out in doing this? This is my first attempt to write a batch file & kindly bear with me if I had asked a very basic question.

Thanks,
karthizen
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2009
Added on Aug 14 2009
15 comments
12,512 views