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

Home -> Community -> Usenet -> c.d.o.server -> Re: Easy SQL*Plus question (I think)

Re: Easy SQL*Plus question (I think)

From: Tim Lange <tim.lange_at_abbott.com>
Date: Thu, 14 Oct 1999 14:08:11 -0500
Message-ID: <38062A1B.41F2886@abbott.com>


Yes, use two ampersands instead of one. It will only prompt you once. Also, the variable will not be deleted after execution, so if you run any query using the variable, you will not be prompted. Tim

Anne Hanson wrote:

> Is there a simple way to set up the following SQL statement so I'm not
> prompted 3 times for the &chaintab substitution variable? I've read the
> Oracle online documentation on substitution variables and I bet someone
> in this newgroup probably can answer my question a lot more clearly.
>
> CREATE TABLE TMPP_&chaintab
> AS SELECT * FROM &chaintab
> WHERE ROWID IN
> (SELECT head_rowid
> FROM chained_rows
> WHERE table_name = '&chaintab');
>
> The backdrop of my question: I am creating a script that will be used on
> multiple tables with chained rows, in which I will copy these rows to a
> temp table, delete them from the source table and then re-insert into
> source table. So ideally I'd like to input the &chaintab variable or
> something similar once and then have it used throughout the script in
> various SQL and/or PL/SQL statements. Any suggestions for automating
> this process also are appreciated!
>
> Thanks,
>
> Anne
Received on Thu Oct 14 1999 - 14:08:11 CDT

Original text of this message

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