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: Perform Subscript from File in PL/SQL

Re: Perform Subscript from File in PL/SQL

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 1 Oct 2002 11:18:06 -0700
Message-ID: <2687bb95.0210011018.423d5758@posting.google.com>


rainer.hirthammer_at_software-objects.com (Rainer Hirthammer) wrote in message news:<3d99b782.8900027_at_news.btx.dtag.de>...
> How can I do this:
> ...
> BEGIN
> @subscript.sql;
> EXCEPTION
> ...
>
> Thanks, Rainer

Rainer, in general you don't. Instead you would write a sqlplus script that executed several plsql scripts.

If you need to run scripts based on information determined in the plsql scripts then you can potentially use a sqlplus variable and have the plsql scripts or sql statements set the variable value and then execute a script where the variable is the script name: start variablescript..sql

You can also sometimes substitute dynamic sql, execute immediate or dbms_sql, for the script.

Also you can use the spool command to create sql files that you populate via select as in select 'select '||col1||... from table_a where ... and then execute these.

Alternately, you have to resort to using extenal procedures or the interprocess communication routines: dbms_alert and dbms_pipe to send commands/information between sessions.

Some combination of the above methods will generally allow you to do what you need. The problem is selecting the best one for the task.

HTH -- Mark D Powell -- Received on Tue Oct 01 2002 - 13:18:06 CDT

Original text of this message

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