pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gustavo Pinsard <pinsard@rocksolid.com.br>
To: pgsql-odbc@postgresql.org
Subject: Re: INSERT INTO ... RETURNING id not behaving as expected with SQLNumResultCols
Date: Thu, 07 Oct 2010 08:11:57 -0300
Message-ID: <4CADAAFD.2020501@rocksolid.com.br> (raw)
In-Reply-To: <93053.31124.qm@web31806.mail.mud.yahoo.com>
References: <93053.31124.qm@web31806.mail.mud.yahoo.com>

Ryan,

What language are you writing your app? What is the code you're using to 
capture the returning id?

Also, are you aware that you can fire a new SELECT statement after 
you're done inserting?  In scenarios where you wouldn't have much 
concurrency that can be a valid approach.

And don't forget that the OID column is there for you to inspect. Ever 
tried a SELECT OID FROM MyTable ORDER BY OID DESC LIMIT 1 ?

Gustavo

On 07/10/2010 01:04, Ryan Pfeiffer wrote:
> I'm using Postgres 8.4.1 and psqlodbc 08.04.0200. I'm trying to execute a statement INSERT INTO table/values RETURNING id to get the serial id. Problem is, SQLNumResultCols shows that there are zero columns. The statement I used works fine in pgadmin. This seems really basic and I am somewhat new to databases and odbc, but does anyone have a solution?
>
> Thanks,
> Ryan
>
>
>
>

Attachments:

  smime.p7s (application/pkcs7-signature, 5.5K) download

view thread (5+ messages)  latest in thread

Message-ID: <4CADAAFD.2020501@rocksolid.com.br>
Permalink:  ../4CADAAFD.2020501@rocksolid.com.br/
Also on:    postgresql.org/message-id/4CADAAFD.2020501@rocksolid.com.br

 · 

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: pinsard@rocksolid.com.br
  Subject: Re: INSERT INTO ... RETURNING id not behaving as expected with SQLNumResultCols
  In-Reply-To: <4CADAAFD.2020501@rocksolid.com.br>
  References: <93053.31124.qm@web31806.mail.mud.yahoo.com> <4CADAAFD.2020501@rocksolid.com.br>

* 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