Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-06571: Function CALC_AVG does not guarantee not to update database

Re: ORA-06571: Function CALC_AVG does not guarantee not to update database

From: Dean <rilecode_at_chemist.com>
Date: Mon, 11 Oct 1999 17:35:15 -0700
Message-ID: <38028243.FD55D56D@chemist.com>


Thanks,

Worked beautifully.

Rick

TurkBear wrote:

> You need to add a pragma statement to your package spec...
>
> In your case, it would be :
>
> After the return statement ( at the end of the proc),
> add
>
> pragma restrict_references(CALC_AVG,RNDS,WNDS,WNPS);
>
> Or something like that...see the reference manual about the pragma statements...
>
> Dean <rilecode_at_chemist.com> wrote:
>
> >I have written this as a function and as a package. The function works
> >just fine, but when I try to call the same function within a package I
> >get this error. Any Suggestons? There is nothing but select statemnts
> >in the function just calculating an average against criteria that I can
> >use in a view.
> >
> >Function CALC_AVG (CTID in varchar2, ASSAYTR in varchar2, ATYPE in
> >varchar2)
> >
> >return number
> >
> >is
> >
> >TRP_AVG NUMBER(8,3);
> >
> >
> >BEGIN
> >
> >
> > select avg(decode(operator,'=',result,null))
> >
> >into
> >
> > TRP_AVG
> >
> >
> >from
> >
> > secondary_results
> >
> >where
> >
> > assayid = ASSAYTR and
> > sampleid = CTID and
> > datatype = ATYPE;
> >
> >
> >return (TRP_AVG);
> >
> >
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
> http://www.newsfeeds.com The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
Received on Mon Oct 11 1999 - 19:35:15 CDT

Original text of this message

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