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: PL/SQL Question - Calling a procedure dynamically

Re: PL/SQL Question - Calling a procedure dynamically

From: Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 20 Aug 98 20:16:20 +0100
Message-ID: <1312.536T1004T12162947@rheingau.netsurf.de>


marqmarq schrieb am 20-Aug-98 17:10:48 zum Thema "PL/SQL Question - Calling a procedure dynamically":

>Hello,

>Does anybody know how to dynamically call a procedure in PL/SQL.
>I am using Oracle Web Server's Web Request Broker (WRB) and
>am trying to dynamically call a procedure. Here is an
>example of what I am trying to to (the code is dumb but
>it gets to the point:

>BEGIN
> v_GoToPage := 'packname.procedname(TRUE)';

> v_GoToPage; (I would like the procedure above to run here)

>END;

>If anybody knows how I can do this, please let me know.

>Can you respond by e-mail also to "tjm_at_neology.com".

I have not tried that, but it should work:

declare

sql_cur integer;
ignore integer;

begin

   sql_cur := dbms_sql.open_cursor;
   dbms_sql.parse(sql_cur,'begin packname.procedname(TRUE); end;',

                  dbms_sql.v7);

   ignore := dbms_sql.execute(sql_cur); end;

You might have to replace the v7 to something appropriate to your Oracle version. Have a look at your docs.
Also beware, as I'm writing this at home with neither Oracle nor docs at hand, the correct syntax may differ slightly.

>Thank You,
>Tom

Hope that helps,
Lothar

--

Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |

Received on Thu Aug 20 1998 - 14:16:20 CDT

Original text of this message

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