Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    18

    Cool Unanswered: ARRAY in STORED PROCEDURE

    hi all,
    can u explain me about arrays in stored procedure with example.
    i created array type.
    for execute SP i used RAZORSQL, in this array type is not supported with in or out parameter.

    do help me.
    thanks.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Have you seen this page ...

    IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

    Use the search function to find more info.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Dec 2011
    Posts
    18

    Cool Array

    hi..
    hav gone thro this..
    bt not getting that much.
    instead of using
    insert into persons(id, name)
    (select T.i, T.n from UNNEST(ids, names) as T(i, n));

    can we use something like ids[1] or names[1];

    and one more thing..
    here they have hard code array value.

    can i do like
    set ids = ARRAY[0,0,0] or
    set names = ARRAY[null, null, null]

    REPLY SOON...

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Quote Originally Posted by rajshri View Post
    insert into persons(id, name)
    (select T.i, T.n from UNNEST(ids, names) as T(i, n));

    can we use something like ids[1] or names[1];
    Of course you can. It will be "insert into persons values(ids[1],names[1])"

    and one more thing..
    here they have hard code array value.

    can i do like
    set ids = ARRAY[0,0,0] or
    set names = ARRAY[null, null, null]
    0 and null -- isn't that hard coding?

    REPLY SOON...
    Can I remind something,pl? If you want to get a "Reply soon" , pay someone!!! dont expect it from a free forum.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Dec 2011
    Posts
    18

    Cool Array

    hi..
    thanks..

    they have mentioned like
    set ids = ARRAY[5,6,7];
    set names = ARRAY['Bob', 'Ann', 'Sue'];

    nw if i want to pass array list into
    set ids = array[my list];
    hw do i pass it..

    actually i m very new with DB2 and its procedure..

    n sorry for saying reply soon..

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Quote Originally Posted by rajshri View Post
    hi..
    thanks..

    they have mentioned like
    set ids = ARRAY[5,6,7];
    set names = ARRAY['Bob', 'Ann', 'Sue'];

    nw if i want to pass array list into
    set ids = array[my list];
    hw do i pass it..

    actually i m very new with DB2 and its procedure..

    n sorry for saying reply soon..
    You cant do the list thing! You can assign
    id[1]=1
    id[2]=7
    etc.

    Let me know if you find otherwise
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •