Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Plus Default Value for &1 Help
Ethan,
I think you're stuck here.
There isn't any memory structure in sqlplus that I'm aware of that will allow you to check for the existence of variables passed on the command line, without actually checking the variable itself.
Below is the method I use for passing command line variables to sqlplus, and prompting the user if they don't exist.
select '&utest' from dual;
I don't see any way to directly supply a default value in sqlplus, though
it
would really be cool if someone else has a way to do so in sqlplus.
This would likely require something like expect, or Perls Telnet module to catch user input, and timeout if not supplied in a timely manner.
Jared
"Post, Ethan" <Ethan.Post_at_ps.net>
Sent by: root_at_fatcity.com
10/18/2002 02:23 PM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: Subject: SQL Plus Default Value for &1 Help
Anyone got an example for the following...
I have a SQL Script that expects &1 passed into it, however, if &1 is not supplied I would like to use a default value and not stop to prompt the user. I am playing around with new_value and select nvl('&1','foo') from dual...etc...and nothing seems to be working.
Thanks,
Ethan Post
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Post, Ethan
INET: Ethan.Post_at_ps.net
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: Jared.Still_at_radisys.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Oct 18 2002 - 17:03:41 CDT