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!

How to view the return value of RECORD Type of a Function

user13297586Apr 12 2018 — edited Apr 12 2018

Hello Folks

I have a simple query. I am getting 4 different costing codes as input, which I need to return as a record. I created the type as record, then used that as a return in my function. Function got compiled but is not returning me anything when I run. Am I missing out on something?

Following is the code that I have used

TYPE gt_cost IS RECORD

(CC1      VARCHAR2(100),

CC2      VARCHAR2(100),

CC3      VARCHAR2(100),

CC4         VARCHAR2(100));

FUNCTION T_GET_COST (CC1 IN VARCHAR2,

                        CC2 IN VARCHAR2,

                        CC3 IN VARCHAR2,

                        CC4 IN VARCHAR2) RETURN gt_cost IS

    return_val gt_cost;

    BEGIN

        return_val.CC1 := UPPER(CC1);

        return_val.CC2 := UPPER(CC2);

        return_val.CC33 := UPPER(CC3);

        return_val.CC4 := UPPER(CC4);

  

    DBMS_OUTPUT.PUT_LINE('return_val IS ' || return_val.CC1);  

  

    RETURN(return_val);

END T_GET_COST;

The DBMS_OUTPUT is returning correct value, but why I cannot see the return when I run this function?

Please advise.

Thanks

Jade

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2018
Added on Apr 12 2018
11 comments
12,512 views