TSmartQuery+grid trying to update wrong table

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

TSmartQuery+grid trying to update wrong table

Post by jdorlon » Thu 10 Aug 2017 20:00

This is a simplified example, but I put this query in a TSmartQuery attached to a grid, then make edits in the grid, the TSmartQuery attempts to update the "Trgt" table, which does not exist, instead of EMP.

Code: Select all

with
  Trgt as
  (SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO
   from   EMP)
select Trgt.ROWID, EMPNO, ENAME, JOB, MGR, HIREDATE
       , SAL, COMM, DEPTNO
from Trgt
Is there something I can do to tell the TSmartQuery to use EMP instead of Trgt? I tried setting the UpdatingTable property, but that just led to a "wrong UpdatingTable value" message.

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

Re: TSmartQuery+grid trying to update wrong table

Post by MaximG » Tue 15 Aug 2017 14:25

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

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

Re: TSmartQuery+grid trying to update wrong table

Post by MaximG » Wed 06 Sep 2017 12:17

Currently, ODAC supports the automatic generation of UPDATE queries for simple SELECT queries. For complex queries (for example, including the WITH clause), a query for updating the data must be written manually.
In the used query, only one 'Trgt' table is specified in the FROM clause. Therefore, only the name of this table can be specified in the UpdatingTable property. In turn, we will consider the possibility of parsing the WITH clause in the future. You can leave your suggestion at our UserVoice page (https://devart.uservoice.com/forums/104 ... 915-oracle). We will implement this behavior in case if the proposed functionality interests our users.

Post Reply