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: How to execute package's function?

Re: How to execute package's function?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/08/27
Message-ID: <34065f37.14283037@newshost>#1/1

On Wed, 27 Aug 1997 22:04:36 -0700, Stephen <c6635500_at_comp.polyu.edu.hk> wrote:

>Hello all,
>
> If I create a package with function, how to execute this function in
>SQL*PLUS? I know that I can type "exec package_name.procedure_name" in
>SQL*PLUS to execute the package's procedure. But when I type "exec
>package_name.function_name" in SQL*PLUS, an error messages (procedure is
>undefined) will be shown. Could anyone tell me is it possible to execute
>package's function in SQL*PLUS?
>
>Thanks,
>Stephen

You must do something with the function result. You could....

SQL> set serveroutput on
SQL> exec dbms_output.put_line( packge_name.function_name )

Or

SQL> declare
   >     val   varchar2(2000);
   > begin
   >     val := package_name.function_name;
   > end;
   > /



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 Aug 27 1997 - 00:00:00 CDT

Original text of this message

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