sql - How to populate a single-dimension array with result of a query FOR DB2? -
i need populate single-dimension array result set select query.
i have created array type using: create or replace type ur.array_traveler_id bigint array[];
and in stored proc using following select query:
select traveler_id bulk collect arraylist ur.appliedprofile travelerprofileid = p_travelerid;
i have declared arraylist as: declare arraylist ur.array_traveler_id;
i dont know problem db2 not allowing me use bulk collection.
the error getting "an unexpected token "collect" found following.....sqlstate=42601"
please suggest way around.
the bulk collect clause valid in pl/sql context. should running db2 9.7 fix pack 1 or later, database must created in oracle compatibility mode, , procedure must written in pl/sql, not db2 sql pl.
Comments
Post a Comment