pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Andrei Gheorghe <andreigheorghe165@yahoo.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Calling a stored procedure with an array parameter
Date: Thu, 15 Aug 2013 20:08:55 +0300
Message-ID: <520D0B27.1010504@vmware.com> (raw)
In-Reply-To: <1376382777.41649.YahooMailNeo@web162401.mail.bf1.yahoo.com>
References: <1376382777.41649.YahooMailNeo@web162401.mail.bf1.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (3+ messages)  latest in thread

Message-ID: <520D0B27.1010504@vmware.com>
Permalink:  ../520D0B27.1010504@vmware.com/
Also on:    postgresql.org/message-id/520D0B27.1010504@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: hlinnakangas@vmware.com, andreigheorghe165@yahoo.com
  Subject: Re: Calling a stored procedure with an array parameter
  In-Reply-To: <520D0B27.1010504@vmware.com>
  References: <1376382777.41649.YahooMailNeo@web162401.mail.bf1.yahoo.com> <520D0B27.1010504@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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