Page 1 of 1

OLD_ID and ID Fields in generated update statement

Posted: Sun 05 Aug 2007 21:52
by grexhide
1. CREATE TABLE TEST(ID number, OLD_ID number);

2.
DataSet.Update;
DataSet.FieldByName('ID').AsInteger := 10;
DataSet.FieldByName('OLD_ID').AsInteger := 20;
DataSet.Post;

Act: ODAC (6.10) generates statement like:

UPDATE TEST
SET
ID = :ID, OLD_ID = :OLD_ID
WHERE
ID = :OLD_ID

Exp:

UPDATE TEST
SET
ID = :ID, OLD_ID = :OLD_ID
WHERE
ID = :_ID


P.S. This issue exists in any case of OLD_ like named field

P.S.S. DELETE statement also still affected

Posted: Mon 06 Aug 2007 11:01
by Plash
You should set the KeyFields property to 'ROWID' or manually write the SQLUpdate and SQLDelete statements.

Posted: Fri 10 Aug 2007 20:31
by grexhide
Plash wrote:You should set the KeyFields property to 'ROWID' or manually write the SQLUpdate and SQLDelete statements.
You think i`m so stupid? Really? :\

Doubt answer.. no more. Thank`s for "support". Now I`m has one more argument - ODAC are bad choice for us. Thanks.