I have the following statement that is fine in my package:
Package header:
TYPE role_user_type is RECORD (ROLE_ID some_ table.ROLE_ID% TYPE, SUBGROUP some_table.USER_ID% TYPE); Body:
ROLE_USER_REC MY_PACKAGE.ROLE_USER_TYPE; SELECT B.USER_ID, from some_table to ROLE_USER_REC, where is the skeleton to loop through user_id such as 'M%' ROLE_USER_REC ? Can we also loop through it?
There is nothing for the loop.
role_user_type defines a single record through which you can access:
dbms_output.put_line (role_user_rec.role_id | | ',' || role_user_rec.subgroup); Your SELECT ... INTO is returned more than once.
If you need to store many of those records, <<> example :
:DECLARE TYPE role_user_type is RECORD (ROLE_ID VARCHAR2 (10), SUBGROUP VARCHAR2 (10)); TYPE role_user_tab is the role_user_type table; Role_user_rec role_user_tab; Collect 'A', 'B' from Bulk Dual in Role_Up_Rec; FOR I IN role_user_rec.FIRST .. role_user_rec.LAST LOOP dbms_output.put_line (role_user_rec (i) .role_id || ',' role_user_rec (i) .subgroup); End loop; End;
Comments
Post a Comment