apex collection add element

Solutions on MaxInterview for apex collection add element by the best coders in the world

showing results for - "apex collection add element"
Tess
31 Nov 2016
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;
Dewayne
09 Feb 2019
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;