Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-06503: PL/SQL: Function returned without value ORA-06512:

994122Jul 16 2014 — edited Jul 17 2014

Hi all,

SQL> set serveroutput on

SQL> CREATE OR replace FUNCTION qty_value(p_item_id IN NUMBER)

  2  RETURN NUMBER

  3  IS

  4    v_qty_arrival NUMBER;

  5  BEGIN

  6      SELECT CASE

  7               WHEN ( SUM (b.quantity) - SUM (b.quantity_received) ) <= 0 THEN 0

  8               ELSE ( SUM (b.quantity) - SUM (b.quantity_received) )

  9             END Qty_Arrival

10      INTO   v_qty_arrival

11      FROM   po_lines_all a,

12             po_line_locations_all b

13      WHERE  a.po_line_id = b.po_line_id

14             AND a.item_id = p_item_id;

15  EXCEPTION

16    WHEN OTHERS THEN

17               v_qty_arrival := NULL;

18               RETURN v_qty_arrival;

19  END qty_value;

20    /

Function created.

SQL>

SQL> select xxc_qty_arrivale(214960) from dual

  2  /

select xxc_qty_arrivale(214960) from dual

       *

ERROR at line 1:

ORA-06503: PL/SQL: Function returned without value

ORA-06512: at "APPS.XXC_QTY_ARRIVALE", line 19

This post has been answered by Hoek on Jul 16 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2014
Added on Jul 16 2014
19 comments
8,740 views