Batch file to connect Sql*plus
717309Aug 14 2009 — edited Aug 14 2009Hi,
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