Page 1 of 1
[ODAC 6.25.1.4013] Automatic update doesn't work
Posted: Wed 16 Jan 2008 15:51
by nschmied
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
Posted: Wed 16 Jan 2008 15:52
by nschmied
I forget to say I use TSmartQuery component.

Posted: Thu 17 Jan 2008 13:17
by nschmied
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
Posted: Thu 17 Jan 2008 14:11
by Plash
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
Posted: Thu 17 Jan 2008 15:54
by nschmied
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
Posted: Fri 18 Jan 2008 11:43
by Plash
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.
Posted: Fri 18 Jan 2008 13:05
by nschmied
Thx for your feedback and fast support.
best regard,