Skip to Main Content

APEX

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!

Adding data to collection using table data from apex_data_parser

abe50May 11 2021 — edited May 11 2021

Hi,
I have a text area users use to cut and paste some delimited data. I would like take their data and parse it and store it in a collection. The data gets parsed just fine but the add to collection puts in the clob column field. Here is a code I am using.

 DECLARE
    l_data RAW(32767);
BEGIN
    l_data := sys.utl_raw.cast_to_raw(:p86_user_input);
    IF apex_collection.collection_exists(p_collection_name => 'P86_COLLECTION') THEN
        apex_collection.truncate_collection(p_collection_name => 'P86_COLLECTION');
    ELSE
        apex_collection.create_collection('P86_COLLECTION');
    END IF;

    FOR x IN (
        SELECT
            col001
        FROM
            TABLE ( apex_data_parser.parse(p_content => to_blob(l_data), p_store_profile_to_collection => 'FILE_PARSER_COLLECTION',
                                          p_csv_col_delimiter => '',
                                          p_file_type => 2) )
    ) LOOP
        apex_collection.add_member(p_collection_name => 'P86_COLLECTION', p_c001 => x.col001);
    END LOOP;
END;
Comments
Post Details
Added on May 11 2021
0 comments
467 views