ORA-06503: PL/SQL: Function returned without value : ORA Error « System Packages « Oracle PL / SQL

Home
Oracle PL / SQL
1.Aggregate Functions
2.Analytical Functions
3.Char Functions
4.Constraints
5.Conversion Functions
6.Cursor
7.Data Type
8.Date Timezone
9.Hierarchical Query
10.Index
11.Insert Delete Update
12.Large Objects
13.Numeric Math Functions
14.Object Oriented Database
15.PL SQL
16.Regular Expressions
17.Report Column Page
18.Result Set
19.Select Query
20.Sequence
21.SQL Plus
22.Stored Procedure Function
23.Subquery
24.System Packages
25.System Tables Views
26.Table
27.Table Joins
28.Trigger
29.User Previliege
30.View
31.XML
Oracle PL / SQL » System Packages » ORA Error 
ORA-06503: PL/SQL: Function returned without value
  

SQL>
SQL>
SQL> CREATE TABLE emp
  2   (emp_id              INTEGER             NOT NULL
  3   ,fname               VARCHAR2(30 CHAR)   NOT NULL
  4   ,mid_name           VARCHAR2(CHAR)
  5   ,lname                VARCHAR2(30 CHAR)   NOT NULL
  6   ,CONSTRAINT emp_pk PRIMARY KEY (emp_id));

Table created.

SQL>
SQL>
SQL>
SQL> SET ECHO ON
SQL>
SQL>
SQL> 
SQL> DECLARE
  2     TYPE emp_record IS RECORD (emp_id INTEGER,fname VARCHAR2(30 CHAR),mid_name  VARCHAR2(CHAR),lname VARCHAR2(30 CHAR));
  3
  4     emp emp_RECORD;
  5
  6     FUNCTION get_row (emp_id_in INTEGER)
  7     RETURN emp_RECORD IS
  8       CURSOR c (emp_id_cursor INTEGERIS SELECT FROM emp WHERE emp_id = emp_id_cursor;
  9
 10     BEGIN
 11       FOR i IN c(emp_id_inLOOP
 12         RETURN i;
 13       END LOOP;
 14
 15     END get_row;
 16
 17   BEGIN
 18     emp := get_row(1);
 19     dbms_output.put_line(CHR(10));
 20     dbms_output.put_line('emp_ID  : '||emp.emp_id);
 21     dbms_output.put_line('fname     : '||emp.fname);
 22      dbms_output.put_line('mid_name : '||emp.mid_name);
 23     dbms_output.put_line('lname      : '||emp.lname);
 24
 25   END;
 26   /
DECLARE
*
ERROR at line 1:
ORA-06503: PL/SQL: Function returned without value
ORA-06512: at line 15
ORA-06512: at line 18


SQL>
SQL>
SQL>
SQL>
SQL> drop table emp;

Table dropped.

SQL>
SQL>

   
    
  
Related examples in the same category
1.ORA-00918: column ambiguously defined
2.ORA-00934: group function is not allowed here
3.ORA-00979: not a GROUP BY expression
4.ORA-01403: no data found
5.ORA-01403: no data found exception from procedure
6.ORA-01422: exact fetch returns more than requested number of rows
7.ORA-01426: numeric overflow
8.ORA-01839: date not valid for month specified
9.ORA-06502: PL/SQL: numeric or value error
10.ORA-06502: PL/SQL: numeric or value error: character to number conversion error
11.ORA-06502: PL/SQL: numeric or value error: number precision too large
12.ORA-14551: cannot perform a DML operation inside a query
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.