pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Retrieving output bind parameters not working
3+ messages / 2 participants
[nested] [flat]

* Retrieving output bind parameters not working
@ 2014-01-29 14:48 Andrei Gheorghe <andreigheorghe165@yahoo.com>
  2014-01-29 21:05 ` Re: Retrieving output bind parameters not working Martin J. Evans <bohica@ntlworld.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrei Gheorghe @ 2014-01-29 14:48 UTC (permalink / raw)
  To: pgsql-odbc

Hello,

I'm trying to call a procedure that takes two OUT parameters and one IN parameter
but the buffers for the two OUT parameters I've called SQLBindParameter on 
aren't filled after executing "SELECT procedure(?, ?, ?)". The procedure does 
return them as "(value1, value2)". 

Also, when I try to execute "{CALL procedure (?,?,?)}", I get an access violation 
in psqlodbc35w.dll.
The code I'm trying right now was used with other ODBC drivers and it was working.

Am I doing something wrong or does Postgres deal differently with OUT parameters?

Thank you

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

* Re: Retrieving output bind parameters not working
  2014-01-29 14:48 Retrieving output bind parameters not working Andrei Gheorghe <andreigheorghe165@yahoo.com>
@ 2014-01-29 21:05 ` Martin J. Evans <bohica@ntlworld.com>
  2014-01-30 09:22   ` Re: Retrieving output bind parameters not working Andrei Gheorghe <andreigheorghe165@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Martin J. Evans @ 2014-01-29 21:05 UTC (permalink / raw)
  To: pgsql-odbc

On 29/01/2014 14:48, Andrei Gheorghe wrote:
> Hello,
>
> I'm trying to call a procedure that takes two OUT parameters and one IN
> parameter
> but the buffers for the two OUT parameters I've called SQLBindParameter on
> aren't filled after executing "SELECT procedure(?, ?, ?)". The procedure
> does
> return them as "(value1, value2)".
>
> Also, when I try to execute "{CALL procedure (?,?,?)}", I get an access
> violation
> in psqlodbc35w.dll.
> The code I'm trying right now was used with other ODBC drivers and it
> was working.
>
> Am I doing something wrong or does Postgres deal differently with OUT
> parameters?
>
> Thank you

I don't use the Postgres ODBC driver for real and I only hang about on 
this list as I look after Perl DBD::ODBC.

In some ODBC drivers output parameters passed to procedures are only 
available after SQLMoreResults returns negatively i.e., your procedure 
must finish before the output bound parameters are available and 
certainly in MS SQL Server unless nocount is on, any 
insert/update/delete requires SQLMoreResults to be called repeatedly to 
walk through the results in the procedure.

I've no idea if this is the reason for your first problem but thought it 
worth mentioning.

Martin
-- 
Martin J. Evans
Wetherby, UK


-- 
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: Retrieving output bind parameters not working
  2014-01-29 14:48 Retrieving output bind parameters not working Andrei Gheorghe <andreigheorghe165@yahoo.com>
  2014-01-29 21:05 ` Re: Retrieving output bind parameters not working Martin J. Evans <bohica@ntlworld.com>
@ 2014-01-30 09:22   ` Andrei Gheorghe <andreigheorghe165@yahoo.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrei Gheorghe @ 2014-01-30 09:22 UTC (permalink / raw)
  To: Martin J. Evans <bohica@ntlworld.com>; pgsql-odbc



Thank you Martin for your reply.
Apparently we did have a bug in our code that was causing the access violation. Everything is working right now.


On Wednesday, January 29, 2014 11:06 PM, Martin J. Evans <bohica@ntlworld.com> wrote:
 
On 29/01/2014 14:48, Andrei Gheorghe wrote:

> Hello,
>
> I'm trying to call a procedure that takes two OUT parameters and one IN
> parameter
> but the buffers for the two OUT parameters I've called SQLBindParameter on
> aren't filled after executing "SELECT procedure(?, ?, ?)". The procedure
> does
> return them as "(value1, value2)".
>
> Also, when I try to execute "{CALL procedure (?,?,?)}", I get an access
> violation
> in psqlodbc35w.dll.
> The code I'm trying right now was used with other ODBC drivers and it
> was working.
>
> Am I doing something wrong or does Postgres deal differently with OUT
> parameters?
>
> Thank you

I don't use the Postgres ODBC driver for real and I only hang about on 
this list as I look after Perl DBD::ODBC.

In some ODBC drivers output parameters passed to procedures are only 
available after SQLMoreResults returns negatively i.e., your procedure 
must finish before the output bound parameters are available and 
certainly in MS SQL Server unless nocount is on, any 
insert/update/delete requires SQLMoreResults to be called repeatedly to 
walk through the results in the procedure.

I've no idea if this is the reason for your first problem but thought it 
worth mentioning.

Martin
-- 
Martin J. Evans
Wetherby, UK


-- 
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


end of thread, other threads:[~2014-01-30 09:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29 14:48 Retrieving output bind parameters not working Andrei Gheorghe <andreigheorghe165@yahoo.com>
2014-01-29 21:05 ` Martin J. Evans <bohica@ntlworld.com>
2014-01-30 09:22   ` 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