logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Access - ODBC - serial problem...: msg#00062

db.postgresql.odbc

Subject: Re: Access - ODBC - serial problem...

Philippe Lang wrote:

Hello,

I have made some more tests regarding my precedent post "[ODBC] Access - ODBC -
index strange bug", and in fact it is not index-related. The bug is just more
visible when an index is used, apparently.

The problem comes from the serial identifier, which is not know from the client
at the time the record is being inserted.

With the table described below, imagine I do, from the client:

insert into test (code) VALUES (20);

How does the client know the id that has been given to the record? With ethereal, I could see Access fetches the id by doing a
select id from test where code = 20"

Of course, another record has the same code, and the wrong id is being fetched
back. This explains what I have noticed, and that is explained below...

Is there a solution to that, except inserting records with PL-PGSQL, which I
already do in some cases, by the way...?

I would love it if one of the resident Postgres gurus could verify this, but I think running "select currval('test_id_seq')" ought to do exactly what you want in this case. It should tell you the most recent id assigned by the sequence in your session.

Can someone please verify that this command does not suffer races?

Shachar

--
Shachar Shemesh
Lingnu OpenSource Consulting
http://www.lingnu.com/


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo