Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » PostgreSQL GetInsertedId()
Re: PostgreSQL GetInsertedId() [message #16720 is a reply to message #16697] Tue, 08 July 2008 15:57 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
zsolt wrote on Mon, 07 July 2008 16:48

I think, GetInsertedId(const char* seqence = 0) would be useful.
MySql and SQLite classes would simply neglect this parameter, PostrgreSQL would use parameter as a sequence name to return "SELECT currval('%s')".

This way we could create portable database software.


Well, I sort of see your argument now, but this is fundamentally broken w.r.t concurency.

What if other client inserts a record between your INSERT and SELECT?

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Quick explanation of function calls for postgresql
Next Topic: db access to MS ACCESS
Goto Forum:
  


Current Time: Mon May 13 15:30:32 CEST 2024

Total time taken to generate the page: 0.01692 seconds