Function 'myfunc' may not be used in SQL

From: Kevin S <>
Date: Tue, 7 Oct 2008 08:29:58 -0700 (PDT)
Message-ID: <>


I have created a simple function for use in an update statement. The fuction is

  FUNCTION myfnc(p1 IN t1.c1%TYPE)

         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

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? Received on Tue Oct 07 2008 - 10:29:58 CDT

Original text of this message