Re: SQLPLUS/Ora7 Multiple Table Deletes?

From: Ian Bainbridge <bainbridge_i_at_perc03_at_bgers.co.uk>
Date: 1995/06/23
Message-ID: <3seo88$b4f_at_atlas.bgers.co.uk>#1/1


In article <3semds$h3s_at_wrdis02.robins.af.mil>, gbuc_at_edls2.robins.af.mil (Gregory E. Buchanan) writes:
::From: gbuc_at_edls2.robins.af.mil (Gregory E. Buchanan)
::Newsgroups: comp.databases.oracle
::Subject: SQLPLUS/Ora7 Multiple Table Deletes?
::
:: We are trying to use a sqlplus script to allow a user to delete
::from 3 different tables by entering the key value ONCE. This is
::what we have to do now:
::
::>> delete from table_1 where field = '&Value';
::>> delete from table_2 where field = '&Value';
::>> delete from table_3 where field = '&Value';
::
::Same value for field, but deleted in 3 tables. However, we get
::an error telling that the code is not ended properly.
::
::QUESTION: Is there a way to have the user enter the key value
:: ONCE, but have sql delete it from -3- different tables?
::
::Thank you for your assistance..
::
::--
::Gregory E. Buchanan gbuc_at_edls2.robins.af.mil
::========================================================================
::"I've given up on trying to figure out who killed Mr. Burns.."
::
 

 Yes, simply use '&&Value'. The first time it encounters &&Value it checks  so see if the variable already exists. If not it prompts the user for the  value to be used. On subsequent checks, the variable exists so it does  not reprompt.

 See SQL*PLUS Users reference for references to ACCEPT, DEFINE and UNDEFINE.

  Use ACCEPT to prompt the user for the variable but at the end of your   script (or the beginning) use UNDEFINE to ensure that the previous value   is erased.         

-- 
+--------------------------+-------------------------+-----------------------+
| Ian Bainbridge           | bainbridge.i_at_bgers.co.uk|Phone: (44)191-216-0202|
| British Gas ERS          | Newcastle Upon Tyne, UK |            x2790      |
+--------------------------+-------------------------+-----------------------+
Received on Fri Jun 23 1995 - 00:00:00 CEST

Original text of this message