Page 1 of 1

TSmartQuery+grid trying to update wrong table

Posted: Thu 10 Aug 2017 20:00
by jdorlon
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.

Re: TSmartQuery+grid trying to update wrong table

Posted: Tue 15 Aug 2017 14:25
by MaximG
Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

Re: TSmartQuery+grid trying to update wrong table

Posted: Wed 06 Sep 2017 12:17
by MaximG
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.