Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQLPlus Substitution Variables

Re: SQLPlus Substitution Variables

From: Philip Douglass <philipd_at_sirs.com>
Date: Wed, 15 Jan 2003 08:59:12 -0800
Message-ID: <F001.00530635.20030115085912@fatcity.com>


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 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.net
--

Author: McBain, Neil SITI-ITDSEL314
  INET: Neil.N.McBain_at_is.shell.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).

--

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 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 Wed Jan 15 2003 - 10:59:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US