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 function as a parameter to another PL/SQL function?

Re: PL/SQL function as a parameter to another PL/SQL function?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/05/07
Message-ID: <3371d278.13991168@newshost>#1/1

On 6 May 1997 21:15:14 GMT, "Brian Gastineau" <bgastine_at_giveblood.org> wrote:

>Can a PL/SQL function be passed into another PL/SQL function? My situation
>is that during conversion of data, several different tests will be run
>against each record, but the response to the true/false condition will be
>the same.
>
>Suggestions for workarounds would also be appreciated.
>
>Thanks,
>Brian Gastineau
>bgastine_at_giveblood.org

Yes, pl/sql functions may be used as IN parameters to other pl/sql functions, for example:

SQL> l
  1 declare
  2 function foo( x in varchar2 ) return varchar2   3 is
  4 begin
  5 return upper(x);
  6 end foo;
  7 function bar( y in varchar2 ) return varchar2   8 is
  9 begin
 10 return initcap( y );
 11 end bar;
 12 begin
 13 dbms_output.put_line( bar( foo( 'Hello!' ) ) );  14* end;
SQL> /
Hello!  

PL/SQL procedure successfully completed.  

SQL> Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed May 07 1997 - 00:00:00 CDT

Original text of this message

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