Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Function NOT returning value
On Thu, 12 Nov 1998 01:18:06 GMT, "Miles Palmer"
<miles.palmer_at_mci.com> wrote:
>I just created my first Oracle(8) function and it compiles fine. The only
>problem is that when I run it, I get back an ORA message saying that the
>function did not return a value. Just to be safe, I stripped out all the
>code except one line to put a CHAR value in the return variable....Same
>problem.
>
>I am doing this by the book and I am stumped...Any ideas??
You need an explicit RETURN statement, not a variable.
Thus the shortest example is:
CREATE FUNCTION zero RETURN INTEGER IS
BEGIN
RETURN 0;
END;
HTH
--
Tommy Wareing
MIS Group
Learning Resources
Oxford Brookes University
01865 483389
Received on Mon Nov 16 1998 - 06:19:23 CST