I'm having a hard time passing an array parameter to a pl/sql function on a PostgreSQL server.
My pl/sql function's signature is:
Code:
FUNCTION find_professionals(int4[], int4[], int4[], int4, int4).
I tried using some combination of the following (where divisions, types and areas are java.util.Collection)
Code:
final String sql = "SELECT * FROM find_professionals(:divisions, :types, :areas, 25, 0)";
final SQLQuery query = session.getSession().createSQLQuery(sql);
query.setParameterList("divisions", divisions);
query.setParameterList("types", types);
query.setParameterList("areas", areas);
But I always get the following error:
Quote:
ERROR: function find_professionals(character varying, character varying, character varying, integer, integer) does not exist
Which is somewhat normal if my arrays are transformed into "character varying", which seems to be the signature to a string (varchar type).
The correct query (which works fine when querying from the SQL window in pgAdmin) I should be sending to PostgreSQL is:
Code:
SELECT organizationid FROM find_professionals('{15416}', '{4}', '{21,22,23}', NULL, NULL) AS tab(organizationid int4)
Thanks in advance, this is a pretty major problem for me right now.
P.S.: post might be in double. I pressed 'submit' then cancelled to tick email notification and submitted again.