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: Rainer Hirthammer <rainer.hirthammer_at_software-objects.com>
Date: Wed, 02 Oct 2002 11:25:25 GMT
Message-ID: <3d9aac27.767543@news.btx.dtag.de>


Thank you. My intention is to embed update-scripts in an enclosing body, where I first check the conditions for update and finally I evaluate the results.
I would be very pleased if I could accomplish to read a textfile into a varchar and execute immediate it (at client-side, no UTL_FILE (?)), is there a way to?

On 1 Oct 2002 11:18:06 -0700, Mark.Powell_at_eds.com (Mark D Powell) wrote:
>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
>> ...
>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.
Received on Wed Oct 02 2002 - 06:25:25 CDT

Original text of this message

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