Skip site navigation (1) Skip section navigation (2)

RE: [INTERFACES] ecpg and getting just assigned serial number

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'Michael Meskes'" <meskes(at)postgresql(dot)org>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: RE: [INTERFACES] ecpg and getting just assigned serial number
Date: 1999-09-15 07:50:52
Message-ID: 1BF7C7482189D211B03F00805F8527F748C084@S-NATH-EXCH2 (view raw or flat)
Thread:
Lists: pgsql-interfaces
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?

If anything is going to be returned in sqlca, it should only be the oid, at
least until Postgres gets a serial type (and probably after that as well),
and each table is guaranteed to only have one serial.  In effect, that's
what the oid is, so if the insert returns the oid in sqlca, then you can
select based on the oid.  Problem solved.  And this is only for a single
insert (i.e. an insert with the VALUES keyword).  For multiple inserts
(INSERT INTO <table> SELECT ...) this must be undefined, unless there is a
way of getting and returning all the oids, but I doubt it.

MikeA

>> -----Original Message-----
>> From: Michael Meskes [mailto:meskes(at)postgresql(dot)org]
>> Sent: Tuesday, September 14, 1999 8:32 PM
>> To: Andreas Theofilu
>> Cc: Michael Meskes; pgsql-interfaces(at)postgresql(dot)org
>> Subject: Re: [INTERFACES] ecpg and getting just assigned 
>> serial number
>> 
>> 
>> On Mon, Sep 13, 1999 at 02:11:24PM +0200, Andreas Theofilu wrote:
>> > Informix returns this number in 'sqlca.sqlerrd[1]'. 
>> Currently this field
>> > is not used by ecpg.
>> 
>> Added to TODO. But I doubt this can easily be implemented.
>> 
>> > Maybe ecpg can implement the first call behind the scenes 
>> and put the new
>> > serial number into 'sqlca.sqlerrd[1]'.
>> 
>> No. ECPG does not interpret any command. They are just fed 
>> into the backend.
>> 
>> After an insert the backend returns the number of records 
>> inserted, but does
>> it also return the OID or whatever? I'm not sure but since 
>> an insert could
>> add more than one tuple I doubt that.
>> 
>> 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(at)Fam-Meskes(dot)De           | Use PostgreSQL!
>> 
>> ************
>> 

Responses

pgsql-interfaces by date

Next:From: Michael MeskesDate: 1999-09-15 08:37:24
Subject: Re: [INTERFACES] ecpg and getting just assigned serial number
Previous:From: Byron NikolaidisDate: 1999-09-15 03:36:13
Subject: Re: [INTERFACES] Check boxes with Access

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group