pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Calling a stored procedure with an array parameter
3+ messages / 2 participants
[nested] [flat]

* Calling a stored procedure with an array parameter
@ 2013-08-13 08:32 Andrei Gheorghe <andreigheorghe165@yahoo.com>
  2013-08-15 17:08 ` Re: Calling a stored procedure with an array parameter Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrei Gheorghe @ 2013-08-13 08:32 UTC (permalink / raw)
  To: pgsql-odbc

Hello

I would like to know if I can use the postgres ODBC driver to call a stored procedure with an array parameter. I've managed to do it by binding the parameter as SQL_CHAR with a value like { value1, value 2 }but I would like to know if there's another more efficient way.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Calling a stored procedure with an array parameter
  2013-08-13 08:32 Calling a stored procedure with an array parameter Andrei Gheorghe <andreigheorghe165@yahoo.com>
@ 2013-08-15 17:08 ` Heikki Linnakangas <hlinnakangas@vmware.com>
  2013-08-16 09:00   ` Re: Calling a stored procedure with an array parameter Andrei Gheorghe <andreigheorghe165@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Heikki Linnakangas @ 2013-08-15 17:08 UTC (permalink / raw)
  To: Andrei Gheorghe <andreigheorghe165@yahoo.com>; +Cc: pgsql-odbc

On 13.08.2013 11:32, Andrei Gheorghe wrote:
> Hello
>
> I would like to know if I can use the postgres ODBC driver to call a stored procedure with an array parameter. I've managed to do it by binding the parameter as SQL_CHAR with a value like { value1, value 2 }but I would like to know if there's another more efficient way.

There's no straightforward way to create an array value in the client 
and send it as a query parameter. You could call it with something this 
though:

SELECT my_stored_procedure(ARRAY[?,?,?,?]);

Fill in the parameters with the individual values, and the server will 
construct the array from them.

- Heikki


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Calling a stored procedure with an array parameter
  2013-08-13 08:32 Calling a stored procedure with an array parameter Andrei Gheorghe <andreigheorghe165@yahoo.com>
  2013-08-15 17:08 ` Re: Calling a stored procedure with an array parameter Heikki Linnakangas <hlinnakangas@vmware.com>
@ 2013-08-16 09:00   ` Andrei Gheorghe <andreigheorghe165@yahoo.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrei Gheorghe @ 2013-08-16 09:00 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnakangas@vmware.com>; +Cc: pgsql-odbc

Thank you. It works.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2013-08-16 09:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 08:32 Calling a stored procedure with an array parameter Andrei Gheorghe <andreigheorghe165@yahoo.com>
2013-08-15 17:08 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2013-08-16 09:00   ` Andrei Gheorghe <andreigheorghe165@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox