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!

Validating Connection from Batch file

HulkSep 3 2012 — edited Sep 4 2012
Hi,

I am trying to create a .bat file where I need to take inputs for below variables
DNAME
UNAME
PSWD
So I have done like this
SET /p DNAME="Enter the Database Name "
SET /p UName="Enter the Username "
SET /p Pswd="Enter the Password "

Now I need to validate whether I am able to establish the connection

sqlpus -s "%UName%/%Pswd%@%DNAME%"

if the above connection is valid one then perform certain action else need to echo user that Access is denied.
(ex: I am trying to say if cond is valid
stmt-1
else
echo message to user. )
May I know how can I implement the above step.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2012
Added on Sep 3 2012
3 comments
5,669 views