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: Andreas Köster <AKoester_at_DerPatriot.com>
Date: Fri, 15 Oct 1999 07:54:32 +0200
Message-ID: <3806C198.32417F74@DerPatriot.com>


You can start with

ACCEPT chaintab -
PROMPT "Tablename ? "
...

Andreas Köster

Anne Hanson schrieb:

> 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 Fri Oct 15 1999 - 00:54:32 CDT

Original text of this message

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