Re: Dynamic SQL to call a function with RETURN value?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Tue, 28 Oct 2008 06:58:38 -0700 (PDT)
Message-ID: <998ca790-1246-4cbe-a5ed-806e03c13b25@v15g2000hsa.googlegroups.com>


On Oct 27, 4:24 pm, sybra..._at_hccnet.nl wrote:
> On Mon, 27 Oct 2008 03:41:00 -0700 (PDT), mwmann <mwm..._at_gmail.com>
> wrote:
>
> >I presume that Dynamic SQL is the way to go, but I have not been able
> >to get it right.
>
> Dynamic SQL is the correct method to develop an application which has
> 'DISASTER' inscribed all over it.
> Your description is very vague, and from what I get from it you seem
> to have re-invented a feature which already exists in PL/SQL, albeit
> in packages, called 'Overloading'
> You would need to present much more detail (as well as a database
> version) to find out why you have a desire to end on the electrical
> chair or to make the life of your potential customers miserable.
>
> --
> Sybrand Bakker
> Senior Oracle DBA

I also recommend avoiding use of dynamic SQL unless you cannot solve your business problem any other way.

If you really need dynamic SQL then look in the PL/SQL manual at the execute immediate statement and for more complex SQL look in the PL? SQL Packages and Type Reference manual at the entry for package dbms_sql.

Packages and overloading procedure/function calls as Sybrand mentioned is a potential alternate approach. You might also be able to make use of weakly typed reference cursors.

HTH -- Mark D Powell -- Received on Tue Oct 28 2008 - 08:58:38 CDT

Original text of this message