Re: Is sequencing possible in Mysql?

2001-02-23 Thread Gerald L. Clark
Create a unique key on the id, or date,id. If you insert first, and update if the insert fails, you don't have to lock anything. Inserts and updates are atomic. "Opec Kemp ( Ozemail )" wrote: Basically you'd have a DB set up like this: hits_table

Is sequencing possible in Mysql?

2001-02-22 Thread Alan Halls
I read in the O'reilly book about sequencing but it only mentions msql. Can you do the same thing with Mysql? I have a table that has 2 fields. 1 is an auto-incrementing field the other is a profile id that is joined to some other tables to track how often a record was accessed. The way we are

RE: Is sequencing possible in Mysql?

2001-02-22 Thread Opec Kemp \( Ozemail \)
Hi, Yes that would be a better solution than to keep inserting a new record. However, you'll have to be careful with the concurrent update of the 2nd field ie if 2 process tries to update the same field at the same time etc. So locking table before update would help. I have a table that has 2

RE: Is sequencing possible in Mysql?

2001-02-22 Thread Opec Kemp \( Ozemail \)
Basically you'd have a DB set up like this: hits_table main_table +--+ +-+ | id | (long int) - | id | +--+ +-+ |