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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -