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: Function w/o RETURN clause

Re: Function w/o RETURN clause

From: Barbara Boehmer <baboehme_at_hotmail.com>
Date: 2 Oct 2005 15:58:30 -0700
Message-ID: <1128293910.418755.204980@g47g2000cwa.googlegroups.com>


In 9i, it will compile, but produces an error when you try to use it, as shown below.

scott_at_ORA92> SELECT banner FROM v$version   2 /

BANNER



Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production NLSRTL Version 9.2.0.1.0 - Production

scott_at_ORA92> CREATE OR REPLACE FUNCTION no_return   2 RETURN VARCHAR2
  3 AS
  4 BEGIN
  5 NULL;
  6 -- should have a return clause here   7 END no_return;
  8 /

Function created.

scott_at_ORA92> SHOW ERRORS
No errors.
scott_at_ORA92> SELECT no_return FROM DUAL
  2 /
SELECT no_return FROM DUAL

       *
ERROR at line 1:
ORA-06503: PL/SQL: Function returned without value ORA-06512: at "SCOTT.NO_RETURN", line 5

scott_at_ORA92> Received on Sun Oct 02 2005 - 17:58:30 CDT

Original text of this message

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