Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Function NOT returning value

Re: Oracle Function NOT returning value

From: Tommy Wareing <p0070621_at_brookes.ac.uk>
Date: Mon, 16 Nov 1998 12:19:23 GMT
Message-ID: <365017e1.1127140111@news.brookes.ac.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US