However I found out that LOCK always returns syslckrc=0 (ie: lock was successful), even when the table is opened by somebody else. When this happens, the next error occurs when I try to insert/update a table.
Does this mean LOCK always claims a lock but doesn't actually have write access to a table? Is this a bug? If so, is there any other way I can get exclusive access to write a table?