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!

Creating a Collection from a query

hmaguireMar 16 2018 — edited Mar 16 2018

I am currently using Apex 5.1.4

I am trying to create an apex collection with a sql query like the following.   My page item in the query (:P10_TYPE_SEQ) is a numeric

begin

    if APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'IG_COL_C') then
        APEX_COLLECTION.DELETE_COLLECTION(p_collection_name => 'IG_COL_C');
    end if;

    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
        p_collection_name => 'IG_COL_C',
        p_query => 'select type_cde from type_tbl where type_seq = :P10_TYPE_SEQ'
       );

end;

I receive the following errors

Ajax call returned server error ORA-20104: create_collection_from_query Error:ORA-20104: create_collection_from_query ExecErr:ORA-01008: not all variables bound for Execute PL/SQL Code.

I have tried the following as well - However this does not populate the collection it  is empty

begin

    if APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'IG_COL_C') then
        APEX_COLLECTION.DELETE_COLLECTION(p_collection_name => 'IG_COL_C');
    end if;

    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
        p_collection_name => 'IG_COL_C',
        p_query => 'select type_cde from type_tbl where type_seq = NV(''P10_TYPE_SEQ'')'
       );

end;

Any idea what I am doing wrong?

Thank you

This post has been answered by fac586 on Mar 16 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2018
Added on Mar 16 2018
5 comments
942 views