Re: Function 'myfunc' may not be used in SQL
Date: Tue, 7 Oct 2008 16:19:58 +0000 (UTC)
Kevin S <SearleK_at_googlemail.com> wa:
>I have created a simple function for use in an update statement. The
> FUNCTION myfnc(p1 IN t1.c1%TYPE)
> RETURN VARCHAR2
> IF p1 = 3 THEN
> RETURN 'A';
> RETURN 'B';
> END IF;
> END myfnc;
>I use it in a procedure which exists in the same package as the
>function as follows
>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.
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