Re: Function 'myfunc' may not be used in SQL
From: Aya the Vampire Slayer <ryoko_at_gatech.rmv.this.part.edu>
Date: Tue, 7 Oct 2008 16:19:58 +0000 (UTC)
Message-ID: <gcg27e$n8u$1@news-int.gatech.edu>
Date: Tue, 7 Oct 2008 16:19:58 +0000 (UTC)
Message-ID: <gcg27e$n8u$1@news-int.gatech.edu>
Kevin S <SearleK_at_googlemail.com> wa:
>Hello,
>I have created a simple function for use in an update statement. The
>fuction is
> FUNCTION myfnc(p1 IN t1.c1%TYPE)
> RETURN VARCHAR2
> IS
> BEGIN
> IF p1 = 3 THEN
> RETURN 'A';
> ELSE
> RETURN 'B';
> END IF;
> END myfnc;
>I use it in a procedure which exists in the same package as the
>function as follows
>Update t1
>set c1 = myfnc(c2);
>I am getting Function 'myfunc' may not be used in SQL.
>There is no db manipulation going on and I have tried using
>PRAGMA RESTRICT_REFERENCES (myfnc, WNDS, WNPS, RNDS, RNPS);
>but to no avail.
>Any suggestions?
Use "decode" instead of "myfnc".
-- "Care must be exorcised when handring Opiticar System as it is apts to be sticked by dusts and hand-fat." --Japanese Translators "Keep your fingers off the lens." --Elton Byington, English TranslatorReceived on Tue Oct 07 2008 - 11:19:58 CDT