| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie, How to use procedure/function?
You have to include the package name in your select:
select the_package.first_workday(sysdate) from dual;
When using PL/SQL, you have to enclose the function call in a BEGIN...END block.
In article <5dq26u0fdl78up8a42691qnbgiv7qam4v4_at_4ax.com>, mdent12
@none.com says...
> I downloaded a procedure package from
> http://www.extracon.com/office/oworkdays.htm to allow me to calculate
> first day of month. I run the sql script file to install it and it
> seems to work as I get the msg "Package create" and "Package body
> created". The question is how do I acces it from within my program?
> One of the functions is defined as follows.
>
> FUNCTION first_workday (p_date IN DATE,
> p_unit IN VARCHAR2 := 'MON') RETURN DATE;
> PRAGMA RESTRICT_REFERENCES (first_workday, WNDS, WNPS);
>
> Can I access it from SQL or can I only do that from PL/SQL? What is
> the syntax?
>
> I tried "select first_workday(sysdate) from dual;" in sql.
> "vdate:=first_workday(sysdate);" and "execute first_workday(sysdate);"
> in PL/SQL but nothing seems to work. I always get syntax error. Any
> help appreciated.
>
Received on Wed Feb 06 2002 - 12:05:08 CST
![]() |
![]() |