Re: @@IDENTITY (Was: Access - ODBC - serial problem) - Mailing list pgsql-odbc

From Dave Page
Subject Re: @@IDENTITY (Was: Access - ODBC - serial problem)
Date
Msg-id 03AF4E498C591348A42FC93DEA9661B889FA37@mail.vale-housing.co.uk
Whole thread Raw
List pgsql-odbc

> -----Original Message-----
> From: Philippe Lang [mailto:philippe.lang@attiksystem.ch]
> Sent: 10 April 2004 09:59
> To: pgsql-odbc@postgresql.org
> Cc: scott.marlowe
> Subject: Re: [ODBC] @@IDENTITY (Was: Access - ODBC - serial problem)
>
> > For reasons unfathomable to modern man, Microsoft chose
> @@IDENTITY to mean, not the current user, as I or you or any
> sane person would expect, but to hold the incremented value of
> an autoincrementing column fed by an insert.
> Another triumph in orthogonally named things from Microsoft.

Ahh, that was some good thinking on their part, though it does sorta
make sense.

> - After an insert, Postgresql ODBC driver reads the data
> based on the values that have been inserted. There are cases
> were these values already existed in the table before the
> insert, and so the autoincrement fetched may not be correct.

It does? I wasn't aware of that. I assume you mean when using cursors
(which I never use) as it doesn't following a regular insert statement.

> Is there anything that can be done at the driver level?

Standard answer: The best method would be to do a "SELECT
currval('seq_name');" when required on the relevant sequence.

Regards, Dave.

pgsql-odbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: ODBC driver further developments?
Next
From: "Dave Page"
Date:
Subject: Re: fixes for psqlodbc-07.03.200, patch