By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,196 Members | 973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,196 IT Pros & Developers. It's quick & easy.

SQLPLUS command line question

P: n/a
I'm running sqlplus from a DOS command line and inducing an error by
purposly giving it the wrong script (hence, it cannot find the script
file.) What it is doing is exiting to the SQL> prompt as show below.
What I NEED it to do is exit to the DOS prompt.

c:\>sqlplus someuser/mypass@mydb NonExistantCommandFile.sql
SQL>

Does someone know how this can be done or have a commandline switch
reference that might have the answer?
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
to*********@yahoo.com (tommy) wrote in message news:<4f**************************@posting.google. com>...
I'm running sqlplus from a DOS command line and inducing an error by
purposly giving it the wrong script (hence, it cannot find the script
file.) What it is doing is exiting to the SQL> prompt as show below.
What I NEED it to do is exit to the DOS prompt.

c:\>sqlplus someuser/mypass@mydb NonExistantCommandFile.sql
SQL>

Does someone know how this can be done or have a commandline switch
reference that might have the answer?


Look in the sqlplus manual for logon.sql (or perhaps login) scripts.
You can set parameters in this file that will take affect when the
session is started. You could set the sqlwhenever clause to exit on
failure. At least this is what I would try. I am not on a computer
with Oracle on it so I cannot test my suggestion but it should be
pretty easy to test.

HTH -- Mark D Powell --
Jul 19 '05 #2

P: n/a
Ma*********@eds.com (Mark D Powell) wrote in message news:<26**************************@posting.google. com>...
to*********@yahoo.com (tommy) wrote in message news:<4f**************************@posting.google. com>...
I'm running sqlplus from a DOS command line and inducing an error by
purposly giving it the wrong script (hence, it cannot find the script
file.) What it is doing is exiting to the SQL> prompt as show below.
What I NEED it to do is exit to the DOS prompt.

c:\>sqlplus someuser/mypass@mydb NonExistantCommandFile.sql
SQL>

Does someone know how this can be done or have a commandline switch
reference that might have the answer?


Look in the sqlplus manual for logon.sql (or perhaps login) scripts.
You can set parameters in this file that will take affect when the
session is started. You could set the sqlwhenever clause to exit on
failure. At least this is what I would try. I am not on a computer
with Oracle on it so I cannot test my suggestion but it should be
pretty easy to test.

HTH -- Mark D Powell --


You should place the SQL in your "BIN" directory
and all you should need is

c:\@NonExistantCommandFile

also try saving something from the dos prompt and see where
it gets saved and then place the sql code in that directory
if its not the BIN directory

george
Jul 19 '05 #3

P: 1
I'm running sqlplus from a DOS command line and inducing an error by
purposly giving it the wrong script (hence, it cannot find the script
file.) What it is doing is exiting to the SQL> prompt as show below.
What I NEED it to do is exit to the DOS prompt.

c:\>sqlplus someuser/mypass@mydb NonExistantCommandFile.sql
SQL>

Does someone know how this can be done or have a commandline switch
reference that might have the answer?
inorder to quit from SQL promt to dos prompt type $ else type host
eg: SQL> $
or
SQL>host
Jul 14 '06 #4

P: 2
I'm running sqlplus from a DOS command line and inducing an error by
purposly giving it the wrong script (hence, it cannot find the script
file.) What it is doing is exiting to the SQL> prompt as show below.
What I NEED it to do is exit to the DOS prompt.

c:\>sqlplus someuser/mypass@mydb NonExistantCommandFile.sql
SQL>

Does someone know how this can be done or have a commandline switch
reference that might have the answer?
echo quit | sqlplus someuser/mypass@mydb NonExistantCommandFile.sql

Though that will exit even if you give a valid script - it will run script first however.
Jul 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.