David Cantrell <[EMAIL PROTECTED]> writes:
> Unfortunately no.  You'd have to:
>   LOCK the table
>   SELECT the maximum id currently in use and add one
>   INSERT with that id
>   UNLOCK the table
> so all your other queries will block until the table is unlocked.

Create a 'seq' table associated with each table that needs

LOCK that table.
SELECT the one entry that is the next value in the sequence.
UPDATE the entry with an incremented value.
UNLOCK the sequence table

INSERT into data table using the id you got from the other table.

Which looks to me like it should be faster.

Piers Cawley

Reply via email to