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

From: Mark D Powell <>
Date: Tue, 28 Oct 2008 06:58:38 -0700 (PDT)
Message-ID: <>

On Oct 27, 4:24 pm, wrote:
> On Mon, 27 Oct 2008 03:41:00 -0700 (PDT), mwmann <>
> 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