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: Can Pl/SQL execute a string?

Re: Can Pl/SQL execute a string?

From: Peter H. Larsen <plarsen_at_dc.dynares.com>
Date: Thu, 11 Jun 1998 11:12:06 -0400
Message-ID: <357FF3C6.6D1A1D32@dc.dynares.com>


Hi Sean,
Look at the DMBS_SQL package. For information on how to use the package, just open the header/interface part of the package (use SELECT in SQL*PLUS for instance) and read the comments. But be careful - dynamic SQL is not a novice function.

Sean Dolan wrote:

> I decided to take a different approach to this predicament - which involves piecing together a long string like "SELECT FIELD INTO something FROM SOMETABLE WHERE CRITERIA=2"... Now I would like to pass this string into a stored function and then be able to execute it. So I think I would call the function via 'exec functionname(string)', it would then go into the function, execute that string (which is just a complex SQL statement) and return the values.
>
> I decided on this alternative rather than composing the SELECT statement within the function for simplicity sakes. My program already has put the SQL statement togther but I'd like to be able to pass it to the function.
>
> Thanks,
> Sean Dolan
Received on Thu Jun 11 1998 - 10:12:06 CDT

Original text of this message

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