Re: help need in Pro *c

From: Austin Moseley <\"moseba_at_audv55.aud.alcatel.com'>
Date: 1996/04/05
Message-ID: <4k49bd$i0r_at_news01.aud.alcatel.com>#1/1


ghp_at_infosoft.be (Gerard H. Pille) wrote:
>>I need ur help in solving a problem in Pro *c, i want to run a script
>!>>>>!file from within Pro *c,
>!>
>!>> system("sqlplus user/passwd _at_script");
>!>
>!>
>!>Try using the DBMS_SQL package. Look in your system examples, or
>!>go ask your DBA about it. You have to be running PL/SQL 2.1 or >.
>!>
>!>
>!>-Austin
>!>
>
>The DBMS_SQL package would not allow you to run a script, would it?
>--

It depends upon the script. Most scripts I have seen run have to do with the creation or modification of tables. This is DDL, which DBMS SQL will do. Upload the script, then pass it to DBMS SQL parse.

If the script is DML, then if it has no host variables, then write the script in a general form, then open a cursor on the block, parse the block, then close it.

If it does have host variables, then write it in general form, etc.

( Another idea, which I have not tested, is to have one oracle session up in sqlplus .. then, just get control of this process' stdin channel and write your script to that from another process. Or, run a script from within the sqlplus session which calls a stored procedure or pipe to get the filename of the script to run. This way you only have one sqlplus session up. Still, wasted resources..but, better if many need to run scripts.)

Calls to system() use up a lot of resources which have nothing to do with the execution of the script. If you are interested in exploring this, write a program that calls system() to run itself. :)

-Austin Received on Fri Apr 05 1996 - 00:00:00 CEST

Original text of this message