Search Postgresql Archives

Setting variables equal to elements from an Array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm new to pl/pgsql and postgres and I need some help with a part of
my function.  In the function I loop through a multidemensional array
( [n][3] ), once, while inside the loop, I find the index I want to
work with I would like to set a separate variable equal to the element
in the array at that index ( newVar = array[i] ).

I tried to accomplish this with the following bit of code:

newVar := mnArray[i]

but for some reason that assigned NULL to newVar, then I tried:

newVar := mnArray[i][3:3]

and that appeared to have worked, however when I try to index an
element in the newVar array it produces NULL.  I'm wondering two
things, first, does mnArray[i][3:3] return an array or a string
representation of the element at that index (which in this case is an
array)? and secondly, how do I do what I want to do (make newVar an
array)?

Thanks,

Colin

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux