oracle-databaseoracle-apexoracle-apex-19.1oracle-apex-20.2oracle-apex-20.1

Oracle Apex - Delete member from collection


Is it possible delete from apex collection where C003 = 31

enter image description here


Solution

  • The DELETE_MEMBERS procedure is what are you looking for. To find out more about it please check the official Oracle documentation.

    You can do something like:

    APEX_COLLECTION.DELETE_MEMBERS 
    (
        p_collection_name => 'collection_name',
        p_attr_number     => 3,
        p_attr_value      => '31'
    );
    
    

    Or use the sequence ID.

    DECLARE
    
        CURSOR c_temp IS
        SELECT
            seq_id
        FROM APEX_COLLECTIONS
        WHERE collection_name = 'collection_name'
            AND c003 = '31';
    
    BEGIN
        FOR r_temp IN c_temp LOOP
            apex_collection.delete_member
            (
                p_collection_name => 'collection_name',
                p_seq => r_temp.seq_id
            );
        END LOOP;
    END;