Page 1 of 1
Concurrency violation when updating row
Posted: Tue 08 Feb 2005 13:07
by guest
Is there a way to update rows which have a null value (0000-00-00 00:00:00) in a DateTime field with optimistic locking? I always get a concurrency violation error.
Regards
Dirk
Posted: Wed 09 Feb 2005 10:38
by Serious
In order to update rows which have null values you need to use the following syntax:
Code: Select all
UPDATE
dept
SET
deptno = :p1,
DNAME = :p2,
LOC = :p3
WHERE
((deptno = :p4) AND ((:p5 IS NULL AND DNAME IS NULL) OR (DNAME = :p5)) AND ((:p6 IS NULL AND LOC IS NULL) OR (LOC = :p6)))
This code is compartible with table `dept` (see MySQLDirect .NET demo projects).
If you use data adapters you must manually create update command with similar query.