I tried this instead of the if/else block:
Code: Select all
Result.UpdateBooleanByName('WRITABLE',
(Flags and (DBCOLUMNFLAGS_WRITE or DBCOLUMNFLAGS_WRITEUNKNOWN) <> 0));
The row gets update correctly, but the sql generated is wrong, because it doesn't contain primary key in the WHERE clause.
For example, given this table:
CRATE TABLE test (id INT, txtval VARCHAR(50), PRIMARY KEY(id))
with these records:
INSERT INTO test (id, txtval) VALUES (1, 'aaa')
INSERT INTO test (id, txtval) VALUES (2, 'bbb')
INSERT INTO test (id, txtval) VALUES (3, 'aaa')
And filling a TZQuery object with this statement:
SELECT txtval FROM test
If I try to modify the first row the generated sql is:
UPDATE test SET txtval = 'aaaMOD' WHERE txtval = 'aaa'
that updates two rows instead of one...
Thanks,
Frank