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: How to use the start command in pl/sql or loops in a script

Re: How to use the start command in pl/sql or loops in a script

From: Yosi Greenfield <ygreenfield_at_compuserve.com>
Date: Mon, 08 Nov 1999 09:51:48 -0500
Message-ID: <3826E384.817B8D23@compuserve.com>


One possibility I've used:

  1. Create a 2-column table, line (number (4)) and text (varchar2 (100)). Create a temporary sequence.
  2. Using SQL or PL/SQL, insert rows into the table containing the sequence's nextval and a line of SQL text you want to run - the connect statements, DDL, DML, (or, in your case, @command statements after each connect).
  3. Then spool to a file, select * from <the table> order by line;, spool off
  4. Run the spooled file.

If this message was too short and cryptic, I can elaborate, but it's really simple.

HTH, Yosi

Henrik Otto wrote:

> Hi, Its me again with another question,
> I want to use the sqlplus command 'start <script>' multiple times i.e.
> loop through a bunch of schemas and run the script there. So I either
> want to know how I can run the scripts from pl/sql or how I can make a
> loop or something similar in an sqlplus script. Any ideas?
>
> /Henrik
Received on Mon Nov 08 1999 - 08:51:48 CST

Original text of this message

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