Re: Function 'myfunc' may not be used in SQL

From: <caine.chow_at_gmail.com>
Date: Wed, 14 Nov 2012 09:18:42 -0800 (PST)
Message-ID: <1100c612-28a7-4550-a85b-01bb567acacb_at_googlegroups.com>



On Tuesday, October 7, 2008 3:41:04 PM UTC-6, Malcolm Dew-Jones wrote:
> Kevin S (SearleK_at_googlemail.com) wrote:
> : 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
>
> The SQL statement does not have access to the function unless it is
> declared in the package (header) and referenced using its full name.
>
> -- in package (header)
> FUNCTION myfnc(p1 IN t1.c1%TYPE) RETURN VARCHAR2 ;
>
>
> : Update t1
> : set c1 = myfnc(c2);
>
> Update t1
> set c1 = myPackage.myfnc(c2);

I just wanted to thank Malcolm Dew-Jones. What you gave helped me with my situation. (2 years later :D) Received on Wed Nov 14 2012 - 18:18:42 CET

Original text of this message