Page 1 of 1

HOW TO CALL A STORED PROCEDURE WITH AN ARRAY AS PARAMETER

Posted: Tue 07 Feb 2006 16:07
by baba
I learned how to call a stored procedure, where parameters are simple values.
create or replace function myfunc(param1 INT8, param2 TEXT) RETURNS ...
OK.
But how can i pass array's of something ??

Let's imagine a function like :

create or replace function myfunc(param1 INT8[], param2 TEXT[]) RETURNS ...

How do i code the ARRAYS ??

:?:
I hold my breath.......

Posted: Wed 08 Feb 2006 12:20
by SecureGen
We do not support parameters of array types directly. You should create parameter of VarChar type in PgSqlCommand for every array parameter in stored procedure. During execute you should pass value that corresponds to Postgre SQL server "Array Value Input" format (you can find it in Postgre SQL server documentation).
For your example it could be:
param1 - '{1, 2, 3}'
param2 - '{"string1", "string2", "string3"}'