HOW TO CALL A STORED PROCEDURE WITH AN ARRAY AS PARAMETER

HOW TO CALL A STORED PROCEDURE WITH AN ARRAY AS PARAMETER

Postby baba » Tue 07 Feb 2006 16:07

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.......
baba
 
Posts: 22
Joined: Thu 14 Apr 2005 16:40

Postby SecureGen » Wed 08 Feb 2006 12:20

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"}'
SecureGen
Devart Team
 
Posts: 133
Joined: Thu 08 Sep 2005 06:27


Return to dotConnect for PostgreSQL