How depresssing. I'm doing a lot of work with Sybase these days. That's right, the "enterprise" database. It seems that sequences are not "enterprise" enough and you end up seeing developers resorting to stuff like this instead.
Not that it's relevant in this case, but it's nice to blowoff steam occasionally - especially in an environment where people get it! On 3/29/06, Bas Scheffers <[EMAIL PROTECTED]> wrote: > William Scott Jordan said: > > ns_db dml $db "INSERT INTO test (test_column) SELECT > > COALESCE(MAX(test_column),0) + 1 FROM test" > Ehrm, that is a very, very bad way of creating keys. It is no unlikely > that on a very loaded site two people might insert at the same time and > get the same key! > > The correct way of doing this is using a sequence: -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
