Search Postgresql Archives

Re: PlPg/SQL mulit-array as a parameter?

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

 



am  Sat, dem 07.04.2007, um  6:27:27 -0700 mailte Simon István folgendes:
> How can i use multi-array parameter in PlPg/SQL?
> 
> This array want to put in parameter.
> [[0, 1, 3, 0, 3, 4], [7, 12, 1, 9, 1, 2], [12, 24, 20, 42, 43, 44],
> [24, 103, 65, 113, 72, 25], [179, 357, 335, 348, 309, 138], [3901,
> 3491, 4326, 878, 3785, 450]]

Yes, why not?

Tell us more about what you need and what you have tried. A simple
example:

test=*# create or replace function my_foo(int[]) returns int as $$begin return $1[1][1]; end; $$language plpgsql;
CREATE FUNCTION
test=*# commit;
COMMIT
test=# select my_foo(array[[0, 1, 3, 0, 3, 4], [7, 12, 1, 9, 1, 2], [12, 24, 20, 42, 43, 44], [24, 103, 65, 113, 72, 25], [179, 357, 335, 348, 309, 138], [3901, 3491, 4326, 878, 3785, 450]]);
 my_foo
--------
      0
(1 row)

test=*# select my_foo(array[[10, 1, 3, 0, 3, 4], [7, 12, 1, 9, 1, 2], [12, 24, 20, 42, 43, 44], [24, 103, 65, 113, 72, 25], [179, 357, 335, 348, 309, 138], [3901, 3491, 4326, 878, 3785, 450]]);
 my_foo
--------
     10
(1 row)



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


[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