Re: Re: setting the sequence number using MDB2
| From: | Dan Rossi | Date: | Wed, 20 Apr 2005 10:24:36 +0000 |
| Subject: | Re: Re: setting the sequence number using MDB2 | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18818@lists.php.net to get a copy of this message | ||
cheers dude, it was via the modified dataobject but i was sure it wasnt the problem. I was also going to ask are rollbacks handled on errors for transactions ?
On 20/04/2005, at 7:47 PM, Lukas Smith wrote:
Dan Rossi wrote:Errh its not a code problem as such, say I had a table which was using an autoinc key, then i want to change that to sequences because i need to get the ID while inserting. There is 600 records in there so its up to 600. Say i turn the auto inc key off and allow for sequences its starting at 1 by default, say i change that to 601 , it will add a new row in the seq table and put a 1 there. Now the live system will break if that happens which is why i am coming to you first :)well incrementing is the job of nextID() aside from that you obviously need to properly initialize the sequence. if you are using the mdb schmema you can use the <on> tag to ensure syncronizatzion with a specific field. if you are not then you need to manually increase the sequence or you need to use the $mdb2->manager->createSequence() method which handles an optional starting value. regards, Lukas -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php