469,934 Members | 1,846 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

SQLPLUS command line question

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
4 43871
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
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
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
Nyrine
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.

Similar topics

reply views Thread by Yves | last post: by
reply views Thread by tyousaf | last post: by
2 posts views Thread by tommy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.