OLD_ID and ID Fields in generated update statement

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
grexhide
Posts: 5
Joined: Sat 28 Apr 2007 11:52

OLD_ID and ID Fields in generated update statement

Post by grexhide » Sun 05 Aug 2007 21:52

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 06 Aug 2007 11:01

You should set the KeyFields property to 'ROWID' or manually write the SQLUpdate and SQLDelete statements.

grexhide
Posts: 5
Joined: Sat 28 Apr 2007 11:52

Post by grexhide » Fri 10 Aug 2007 20:31

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.

Post Reply