# [EMAIL PROTECTED] / 2003-06-24 01:02:17 -0600:
> But, I need to know which rows were modified, not simply how many. So
> far this is the best that I have come up with
> 
> LOCK TABLES MyTable WRITE
> SELECT * FROM MyTable WHERE SomeRecord = OldValue
> UPDATE MyTable SET SomeRecord = NewValue WHERE SomeRecord = OldValue
> UNLOCK TABLES
> 
> My question is.. isn't there a better way.  One that doesn't require 4
> queries to do such a simple thing? Or one that can be safely done in a
> multi user environment without locking the table?

    http://www.mysql.com/doc/en/SELECT.html (look for "FOR UPDATE")
    http://www.innodb.com/ibman.html#Locking_reads

-- 
If you cc me or remove the list(s) completely I'll most likely ignore
your message.    see http://www.eyrie.org./~eagle/faqs/questions.html

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to