Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQLPlus Substitution Variables
That's not quite what he asked for...
Erik, you're looking for the DEFINE command, and you don't really need to use '&&' either (unless you want to reuse the script without the DEFINE), e.g.:
define datestamp = "sysdate - 1"
select count(*) from logtab2003
where datestamp = to_char(&datestamp, 'yyyymmdd');
select count(*) from errtab2003
where datestamp = to_char(&datestamp, 'yyyymmdd');
quit
Use && instead of & and you should not get prompted if the variable has a value set.
-----Original Message-----
Sent: 15 January 2003 15:04
To: Multiple recipients of list ORACLE-L
I am using substitution variables in SQLPlus, but don't want to be
prompted
for their values. I want to set them at the start of the script. Kind of
like a preprocessor directive. Is this possible?
Erik
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Erik Williams
INET: ewilliams_at_brownco.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting servicesto: 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).
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting servicesto: 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).
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Philip Douglass
INET: philipd_at_sirs.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting servicesto: 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 Wed Jan 15 2003 - 10:59:12 CST
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
![]() |
![]() |