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

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlplus / passing variable to all instances

Re: sqlplus / passing variable to all instances

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Sun, 12 Feb 2006 16:05:15 -0500
Message-ID: <KoadnU5Gk96RPnLeRVn-gw@comcast.com>

"Joe" <jchristl_at_zdnetmail.com> wrote in message news:1139777520.655271.101450_at_o13g2000cwo.googlegroups.com...
: Hey all,
:
: I'm an admitted newbie when it comes to the meat 'n' potatoes of SQL.
: I can do simple one line selects or updates. but anything bigger than
: that give me the willies.
:
: We have this .sql script that users call to update two different tables
: when the need arises. The problem is the variables entered. For some
: reason, the variable entered won't populate the second calling of it.
: Ex.
:
: UPDATE BOX_VARIATION
: SET LAST_PASS=3
: WHERE BOX_ID=&BOX
: AND VARIATION_NUMBER=&VAR
: /
: UPDATE KEYTOTALS
: SET LAST_PASS='PASS3'
: WHERE BOX_ID=&BOX
: AND VARIATION_NUM=&VAR
: AND RPT_NAME != 'INFX000'
: /
:
: When this is called from the sql> I'd like for the 'box' and 'var'
: variables to pass to both update lines. Is there anyway I can
: accomplish this?
:
: As an added bonus, I would like for a one or two line message to be
: displayed before they enter anything. More of a warning of what to do
: and what not to do. This also has eluded me.
:
: Thank you for any help you are able to provide
:

if you stick with SQL*Plus (i personally do not recommend it for end-user scripts) you'll want to look into DEFINE, ACCEPT, and PROMPT as well as '&&'

what version of oracle? this would be a perfect fit for HTML DB (aka Application Express) if you're 9iR2 or above -- even better if you're at 10gR2

++ mcs Received on Sun Feb 12 2006 - 15:05:15 CST

Original text of this message

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