IBCQuery with joins cannot be edited

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
evdkraan
Posts: 11
Joined: Wed 20 Jan 2010 23:07

IBCQuery with joins cannot be edited

Post by evdkraan » Mon 25 Jan 2010 22:17

If I define a IBCQuery connected to a IBCConnection connected to your demo database and two IBCTransactions (Transaction = iblReadOnlyReadCommitted and UpdateTransaction = iblReadCommitted) and define the following select statement:

Code: Select all

select d.dname, d.loc, e.empno, e.ename, e.job, e.mgr, e.hiredate, e.sal, e.comm, e.deptno
from emp e
join dept d on d.deptno = e.deptno
And then use the SQL Generator to create the Update SQLs for the emp table.

The result set cannot be edited in a DBGrid.

If I define the select statement like this:

Code: Select all

select e.empno, e.ename, e.job, e.mgr, e.hiredate, e.sal, e.comm, e.deptno, d.dname, d.loc
from emp e
join dept d on d.deptno = e.deptno
And then use the SQL Generator to create the Update SQLs for the emp table.

The result set can be edited in a DBGrid.

I'm porting an application from IBObjects to IBDac and in IBObjects the order in the select statement wasn't an issue like it seems to be in IBDac.

Is this a bug or as designed and if it is as designed why is the order in the SQL statement important for IBDac ?

BTW this is the first real big problem I discovered in IBDac that took a lot of time to figure out. Still testing, but I really like what I'm seeing so far :mrgreen:

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

Post by Plash » Tue 26 Jan 2010 08:28

Please set the UpdatingTable property to 'EMP'.

evdkraan
Posts: 11
Joined: Wed 20 Jan 2010 23:07

Post by evdkraan » Tue 26 Jan 2010 15:06

Ok, that worked.

I looked at that property and the description in the help file should have made it clear to me, but I somehow didn't get it :oops:.
Another cool thing about this property is that it is not necessary to define the Update SQL's yourself.

Thanks for the quick reply.

Post Reply