[ODAC 6.25.1.4013] Automatic update doesn't work

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nschmied
Posts: 72
Joined: Mon 09 May 2005 08:03
Location: Suisse

[ODAC 6.25.1.4013] Automatic update doesn't work

Post by nschmied » Wed 16 Jan 2008 15:51

Hi,
I have upgrade from ODAC 6.00 to 6.25 with your last version.
But now automatic CRUD freature doesn't work.
I have tested a simple SQL commande like

Code: Select all

SELECT PC_COLORS.*, PC_COLORS.ROWID FROM PCS.PC_COLORS
with ODAC Demo in VCL.NET version,
and nothing append when I update a row !!!!!!

Thx for your help.
N.Schmied

nschmied
Posts: 72
Joined: Mon 09 May 2005 08:03
Location: Suisse

Post by nschmied » Wed 16 Jan 2008 15:52

I forget to say I use TSmartQuery component.

:oops:

nschmied
Posts: 72
Joined: Mon 09 May 2005 08:03
Location: Suisse

Post by nschmied » Thu 17 Jan 2008 13:17

I have found more information about this issue

If I use this command

Code: Select all

SELECT CL.*,CL.ROWID FROM PCS.PC_COLORS CL
it's work better because I place a alias.

I have trace into code and the diffrence occur in
TOraDataSet.GetFieldsInfo

with SQL command without alias, GetFieldsInof doesn't catch TableInfo for FieldDesc.
And after when SQLGenerator.GenerateUpdateSQL is call. It's return nothing because KeyAndDataFields.DataFieldDescs was empty.

I hope Help you.

NSC

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

Post by Plash » Thu 17 Jan 2008 14:11

In last ODAC builds we have made changes in GetFieldsInfo procedure. Old ODAC versions often generate incorrect update SQLs because table for fields is detected incorrecly.

Several last ODAC builds detect table for fields more strictly. In your query you use table name with schema in the FROM clause, and table name without schema in the SELECT clause. You should use table name in the same format for both clauses to automatic SQL generation work, or use an alias. For example:

Code: Select all

SELECT PCS.PC_COLORS.*, PCS.PC_COLORS.ROWID FROM PCS.PC_COLORS

nschmied
Posts: 72
Joined: Mon 09 May 2005 08:03
Location: Suisse

Post by nschmied » Thu 17 Jan 2008 15:54

Thx for your answer, I have found the same.
And I have make a lite change in your code.
I.e. in TOraDataSet.GetFieldsInfo procedure
after create TColumnInfo you make a test

Code: Select all

if (ColumnInfo.Table = TableName) then
for set TableIndex.

I have make a little change for test .

Code: Select all

           if (ColumnInfo.Table = TableName) or
             (Assigned(TableName) and TableName.EndsWith('.'+ColumnInfo.Table)) then begin
I'm on Dot.NET framework and I have add another test.

What you think about my modification. it's dangerous or not ?

Best Regards,
NSC

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

Post by Plash » Fri 18 Jan 2008 11:43

Your modification should work, and it's not dangerous.

We'll also make changes to support fields without a schema. The changes will be included in the next build of ODAC.

nschmied
Posts: 72
Joined: Mon 09 May 2005 08:03
Location: Suisse

Post by nschmied » Fri 18 Jan 2008 13:05

Thx for your feedback and fast support.

best regard,

Post Reply