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 -> Can DBMS_SQL be used to get the RETURN from a PL/SQL FUNCTION?

Can DBMS_SQL be used to get the RETURN from a PL/SQL FUNCTION?

From: <tmcguiga_at_my-dejanews.com>
Date: Thu, 29 Oct 1998 16:39:32 GMT
Message-ID: <71a5o5$b7k$1@nnrp1.dejanews.com>


I am considering writing PACKAGE in PL/SQL to aid in version control.

Each PACKAGE in the current schema is examined to see if it has a FUNCTION called PKBVCI and a FUNCTION called PKSVCI. This is done via a CURSOR --

CURSOR VCIPackages IS

      SELECT package_name
        FROM user_arguments
       WHERE object_name = 'PKBVCI'
   INTERSECT
      SELECT package_name
        FROM user_arguments
       WHERE object_name = 'PKSVCI';

ASIDE: Should I be tightening up the WHERE clauses to ensure PKBVCI and PKSVCI are actually FUNCTIONs and not, for example, PROCEDUREs. If so, how? Note that the specification of both FUNCTIONs state that they take no arguments and RETURN VARCHAR2. Next, having realised the PACKAGEs which support version control, both the PKBVCI and PKSVCI FUNCTIONs will need to be invoked. But can I do this?

Since the PACKAGE names were established at runtime I think I need dynamic SQL but have no idea how to write the SQL statement.

Do I try 'SELECT ' || <PackageName> ||'.PKBVCI FROM DUAL' or some other 'trick'?

I may be overlooking a much better way of doing this. Any advice concerning invoking FUNCTIONs determined at runtime would be appreciated.

Thanks,

   Tiernan.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Oct 29 1998 - 10:39:32 CST

Original text of this message

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