1BEGIN
2 APEX_COLLECTION.ADD_MEMBER(
3 P_COLLECTION_NAME => 'EMPLOYEE_COLLECTION',
4 P_C001 => :P2_EMP_NO,
5 P_C002 => :P2_EMP_NAME
6 );
7END;
1DECLARE
2 CURSOR c_emp IS
3 SELECT EMP_NO, EMP_NAME FROM EMP;
4BEGIN
5 IF NOT APEX_COLLECTION.COLLECTION_EXISTS('EMPLOYEE_COLLECTION')
6 THEN APEX_COLLECTION.CREATE_COLLECTION('EMPLOYEE_COLLECTION');
7 ELSE APEX_COLLECTION.TRUNCATE_COLLECTION('EMPLOYEE_COLLECTION');
8 END IF;
9
10 FOR c IN c_emp
11 LOOP
12 APEX_COLLECTION.ADD_MEMBER(P_COLLECTION_NAME => 'EMPLOYEE_COLLECTION',
13 P_C001 => c.EMP_NO,
14 P_C002 => c.EMP_NAME
15 );
16 END LOOP;
17END;