TOraTable field not found exception against multi key table

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
moatingodseye
Posts: 1
Joined: Thu 08 Jul 2021 12:33

TOraTable field not found exception against multi key table

Post by moatingodseye » Thu 08 Jul 2021 13:21

Hello,
We have an issue with using ToraTable against a table with a multi field primary constraint.

It looks very similar to viewtopic.php?f=5&t=45577

Basically on trying to use the Edit method of TOraTable we get an exception...

class exception with message 'Field field1,fiield2 not found'

This occurs in the following code.

begin
table.tablename := 'boomtable';
table.open;
table.edit; <-- boom
table.cancel;
table.close;
end;

BUT, only if the table has data present. A blank table does not exhibit the problem. And the table must have a unique index on the two fields.

e.g.

create table boomtable(field1 integer, field2 integer);
create unique index boomindex on boomtable(field1,field2);
insert into boomtable (field1,field2) values (1,1);
insert into boomtable (field1,field2) values (1,2);
insert into boomtable (field1,field2) values (1,3);
insert into boomtable (field1,field2) values (1,4);
insert into boomtable (field1,field2) values (1,5);

If you connect a datasource, dbgrid and dbnavigator to the table and open. You can see the data fine. You can click to add a new row, but on trying to commit the row the same exception occurs.

This is on a brand new vcl application within delphi 10.4.2 and odac 11.4.1. Dropped a TOraSession and TOraTable onto the form. Tweaked the session setting the username/password and server to connect to my Oracle 19 server. Also tried odac 11.4.3 gives the same exceptions.

Hope you can fix this soon.

Thanks

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TOraTable field not found exception against multi key table

Post by MaximG » Fri 09 Jul 2021 08:57

We've reproduced the issue and fixed it. The fix will be included in the next build of our product.

Post Reply