Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Accessing Functions that are part of a Package
"Ajay Mirmira" <am359490_at_oak.cats.ohiou.edu> wrote in message
news:39774f62.822462_at_news.cs.ohiou.edu...
>
> I would like to know how to access functions that are part of a
> package. I have created a package pkg_functions and one of the
> functions in this package is called validate_date. This function
> validates a 8 digit number in the format yyyymmdd. When I created this
> function as a stand alone unit, it worked fine, but when it is part of
> the package, I get the following error:
>
> ERROR at line 1:
> ORA-06571: Function VALIDATE_DATE does not guarantee not to update
> database
>
> The package specification and body compile with out any errors. I
> would be grateful if anybody can help me.
>
> Ajay Mirmira
> ORACLE Applications Programmer
> Ohio University
You are calling your function from a select obviously.
There are two solutions:
If this is *only* to display a result, use dbms_output.put_line(<package
name>.<function name>)
If you really need the select,
you should add the dratted
pragma restrict_references (<function_name>, RNDS, WNDS, WNPS, RNPS) (IIRC)
after your function header.
This is no longer necessary in Oracle 8i.
Hth,
Sybrand Bakker, Oracle DBA Received on Thu Jul 20 2000 - 00:00:00 CDT