Re: DB_Dataoabject

From: Date: Thu, 20 Nov 2003 12:26:48 +0000
Subject: Re: DB_Dataoabject
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23771@lists.php.net to get a copy of this message
Arnaud Limbourg wrote:
Quick note I noticed that in 1.3 changelog
     New Features
- Inserts and updates do not use keys in the data creation part of the query
(Markus Wolff) It sounds like BC to me (just found that out the hard way ;).
Thing is, if this would not have been taken out, some databases (like MSSQL) would have had trouble with the INSERT and UPDATE queries, as you can't even mention the field in such a query if it is defined as auto_increment (or, in the case of MSSQL, "identity"). It really shouldn't be a BC issue. When you specify a value for the Primary Key and do an INSERT, it should be used by DataObject. If not, it will either use a new ID generated by a sequence or leave the field out of the query (using auto_increment). In an UPDATE query, the field will not be included in any case, because as it is the primary key of the row, it's already present. It makes no sense to update it. The field will be user in the WHERE clause though, to correctly identify the row. CU Markus

« previous php.pear.dev (#23771) next »