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 -> Easy SQL*Plus question (I think)

Easy SQL*Plus question (I think)

From: Anne Hanson <ahanson_at_fas.harvard.edu>
Date: Thu, 14 Oct 1999 14:22:57 -0400
Message-ID: <38061F81.A7522701@fas.harvard.edu>


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 - 13:22:57 CDT

Original text of this message

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