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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Need help for VARRAY Looping Object Types

1567114Sep 14 2015 — edited Sep 14 2015

Hello,

I have an Object Type and assigned the VARRAY to the Object type.

I want to loop through the Object type and below is the procdural I performed but not sure sure whether the approach is correct.

CREATE OR REPLACE TYPE ASSET_REC_TYPE IS OBJECT (asset_number VARCHAR2(120)); 

CREATE OR REPLACE TYPE TEST_ASSET_REC_TBL IS VARRAY(1000) of ASSET_REC_TYPE

PROCEDURE ADD_TO_ASSET(

                    p_asset_number_list IN TEST_ASSET_REC_TBL,

                    p_ord_number    IN Varchar2,

                    x_error_flag    OUT Varchar2,

                    x_error_msg      OUT Varchar2

                    )

BEGIN

IF p_lot_number_list.COUNT>0 THEN

  FORALL indx IN p_asset_number_list.FIRST..p_asset_number_list .LAST

  LOOP

    SELECT p_asset_number_list (indx).asset_number INTO var_lot_num FROM p_asset_number_list ;

   

  END LOOP;

END IF;

Please help me to go into the Looping scenario.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2015
Added on Sep 14 2015
10 comments
312 views