Posted Dec 19, 2011 15:05 UTC (Mon) by khim
In reply to: Duh?
Parent article: Cracks in the Foundation (PHP Advent)
Returning the last_insert_id is something every reasonable SQL database must do.
Puhlease. Oracle offers totally different way of doing the same thing. You never pull last_insert_id to your program at all: instead you use currval in the next use insert (update, etc).
I have no problem with getting access to the raw functions. But that kind of implementation detail wants to be abstracted.
Well, it only makes sense if you don't care about resource usage. Because practially the only way to abstract these kind of things is to create interface which works awfully slow for all supported databases. Perhaps some wizard can invent something which will support all common databases in the same fashion and still will work fast - but on practice I'm yet to see such implementation.
to post comments)