Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to execute package's function?
Stephen wrote:
>
> 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?
Yes, but PL/SQL is not like C/C++ in that you must call a function as a function, never as a procedure. So your call must be in the form:
myvar := package_name.function_name;
or
if package_name.function_name > somevalue then
...
-- Tomm Carr --> Note new e-mail address tommcatt@computer.org -- http://www.geocities.com/athens/delphi/6769 -- The Macintosh computer is like the open range; -- In a world without fences, there are no Gates.Received on Wed Aug 27 1997 - 00:00:00 CDT
![]() |
![]() |