oracle - How to make a sqlplus quit when database is not available? -


i have problem sqlplus on windows batch. have sqlplus 10.2

i'm trying connect database through windows script.cmd

script.cmd launches : sqlplus test/test@mydatabase @script.sql

the problem when database not available, sqlplus says

error: ora-12541: tns:no listener enter user-name :  

and waits input .. , blocks .cmd

how can adapt script stop when database not avaliable or avoid waiting user prompts ?

thanks

you can sqlplus -l test/test@mydatabase @script.sql; -l flag means try connect once, , if fails reason exit instead of prompting. @ output of sqlplus -?, or see the documentation.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -