Anyarray as parameter of a RetrievalProcedure

Posts   
 
    
romain
User
Posts: 1
Joined: 07-Sep-2009
# Posted on: 08-Sep-2009 13:56:12   

Hello,

I'm using LLBLGen Pro version 2.6 with PostgreSQL 8.3 and C#.

I wrote a retrieval procedure with an anyarray argument as parameter, but when generating the code LLBLGen creates a function with a System.String as parameter in the RetrievalProcedures object.

1) why doesn't LLBLGen recognizes the anyarray argument?

2) which is the type of the argument I should pass to the function? My goal is to send an array of integers to the SQL function.

Thanks, Romain

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 09-Sep-2009 10:23:30   

romain wrote:

Hello,

I'm using LLBLGen Pro version 2.6 with PostgreSQL 8.3 and C#.

I wrote a retrieval procedure with an anyarray argument as parameter, but when generating the code LLBLGen creates a function with a System.String as parameter in the RetrievalProcedures object.

1) why doesn't LLBLGen recognizes the anyarray argument?

Because LLBLGen Pro doesn't support arrays on Postgresql

2) which is the type of the argument I should pass to the function? My goal is to send an array of integers to the SQL function.

This is a bit complicated, and also one of the reasons why we don't support it: an array of integers is for npgsql actually 2 types: Array + Integer. Our mapping system only supports 1 type per element.

To be able to execute this procedure with llblgen pro, what you could do is copy the generated method into your own class, and change the parameter definition from Varchar to NpgsqlDbType.Array | NpgsqlDbType.Integer, and change the string typed method argument to an int[] typed argument. You then remove the proc from the llblgen pro project in the designer and regenerate your code.

Then, call the code you copied and altered to execute the procedure. It will run the procedure using the underlying llblgen pro code, and you'll be able to pass an array of ints. If you get an error, please let us know and post the code you copied and altered (and the error of course wink )

Frans Bouma | Lead developer LLBLGen Pro