Re: Sequence Numbering

2015-06-30 Thread Johnny Withers
Found the problem here, someone had created on insert and on update triggers on this table that were interferring with the process. This logic works wonderfully when you need sequence numbers that are also transaction safe. The key is you need a unique index on all the columns involved. I think m

Re: Sequence Numbering

2015-06-30 Thread Bob Eby
> If the return value of the UPDATE stmt is zero, the following stmt is ran: By return value I assume you mean "rows affected" ? > This is working great, and has been for many years; however, > today I noticed it was not working on a particular MySQL server. By "not working" what exactly is the

Re: Sequence Numbering

2015-06-29 Thread Peter Brawley
On 2015-06-29 7:03 PM, Johnny Withers wrote: Hello all, I have a tabled defined: CREATE TABLE `store_seq` ( `seq_type_id` smallint(3) unsigned NOT NULL DEFAULT '0', `store_id` int(10) unsigned NOT NULL DEFAULT '0', `loan_model_id` int(10) unsigned NOT NULL DEFAULT '0', `store_bank_i

Re: Sequence Numbering

2015-06-29 Thread Johnny Withers
I should add: By working I mean: The first time the UPDATE stmt runs, it will return a zero value for the seq_id. The insert stmt will initialize it to 1000 The second time the UPDATE stmt runs, it returns 1001. The third time, 1002, etc. When it doesn't work, the second time the code is ran you