I'm working with Delphi 2005 and UniDAC 3.0.0.10, I'm accessing an Oracle database.
An UniTable component is used to append new data to several different existing tables. This is working properly for the first table after start of the application - regardless, which one.
But if I close the table, assign a different TableName and try to write to that second table, I will always get an error like "Key field 'KEY1' not found'. This field is a key field of the first table, but does not exist in the second one. Looks like the UniTable is caching the key field information somewhere?
Code is basically
Code: Select all
UniTable1.TableName:= 'TEST.FIRSTTABLE';
UniTable1.Active:= true;
UniTable1.Append;
UniTable1 ['KEYFIELD1']:= 'Test';
UniTable1 ['NORMALFIELD2']:= 'Test';
UniTable1.Post; // works fine
UniTable1.Active:= false;
UniTable1.TableName:= 'TEST.NEXTTABLE';
UniTable1.Active:= true;
UniTable1.Append;
UniTable1 ['DIFFERENTKEYFIELD1']:= 'Test';
UniTable1 ['ANOTHERFIELD2']:= 'Test';
UniTable1.Post;
What can I do?
Thanks
tw