getting OID of INSERTed record in ECPG - Mailing list pgsql-interfaces

From Matthew Denny
Subject getting OID of INSERTed record in ECPG
Date
Msg-id 14589.17214.758887.216706@caracas.CS.Berkeley.EDU
Whole thread Raw
In response to getting OID of INSERTed record in ECPG  (Matthew Denny <mdenny@CS.Berkeley.EDU>)
Responses Re: getting OID of INSERTed record in ECPG  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
After sending the message below yesterday, I decided to look at the
source to see where sqlca.sqlerrd[1] gets updated.  From what I can
tell, nowhere in ecpglib.c (or any other file) is sqlca.sqlerrd[1] 
even referenced much less updated.  However, the documentation and a
post to psql-interfaces (appended to the bottom of this email) seems
to indicate that sqlca.sqlerrd[1]  will hold the OID of an INSERTed
tuple if a single tuple is inserted.  Do I have the most up-to-date
source and binaries?  Here's what I have:

source:
postgresql-6.5.3.tar.gz (D/Led from postgresql.org)

binaries: (Linux RPMs D/Led from postgresql.org)
postgresql-6.5.3-3.rpm
postgresql-server-6.5.3-3.rpm
postgresql-6.5.3-3.rpm
postgresql-devel-6.5.3-3.rpm
postgresql-examples-1.0-1.rpm

If there is any patches that I am missing here, any help would be
greatly appreciated.  Also, If anyone knows a workaround for getting
the OID of a tuple INSERTed into a table, I would appreciate this as
well.

thanks in advance,
Matt Denny

Matthew Denny writes:> > Does anyone know how to get the OID of an INSERTed tuple when using> PostgreSQL and ECPG?  The
documentationand the mail archives state that the> OID of an INSERTed tuple is placed in sqlca.sqlerrd[1] after the
SQL>call.  Although I can get sqlca to return error messages and error> codes reliably in the same program,
sqlca.sqlerrd[1]always equals 0> even after a successful insert.  Has anyone had this same problem?> I'm using the
Linuxbinary distribution of PostgreSQL 6.5.3-3.  Any> possible solutions or workarounds would be greatly appreciated.>
>thanks,> Matt Denny> >  
 


;; message from psql-interfaces mentioned above



On Wed, Sep 15, 1999 at 09:50:52AM +0200, Ansley, Michael wrote:
> I don't think that a sequence number should be going into sqlca.
This is
> what it sounds like you are going to do, yes?

But this wasn't what I meant. :-)

I wasn't wording very well. What I wanted to say was that I don't see
much
of a chance to give back the serial as such. What I added to my TODO
list
(and btw just committed the changed source) is the return of the OID
for the
singleton insert.

Michael

-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: lo_import problems
Next
From: Peter Mount
Date:
Subject: RE: psql & java