migration to 4.0.7.1: Cannot update view

pult

Member²
I spend migration from version 3.4.6.4 on version 4.0.7.1.

The mistake arises in a file "OracleData.pas" in a methos:

procedure TOracleDataSet.CreateUpdate(...
procedure TOracleDataSet.CreateInsert(...

At query texts there is a word "returning". But it does not work for view. In version 3.4.6.4 of this problem was not.

Probably it is necessary to add property UpdateObjectIsTable:

if UpdateObjectIsTable and (ReturningFrom '') then
DMLQuery.SQL.Add('returning ' + ReturningFrom + ' into ' + ReturningInto);
end;
end;
 
create or replace view v_banklistdet as
select
D.DOC_ID, D.DOC_HOV, d.dog_1_id,
d.k_1_id, d.k_2_id,
D.DOC_DATE, Sum_Curr, D.RATE, D.RATE_2,
d.co_1_id, bld_id, bl_in_id, bl_out_id, pk, doc_no,
description, rate_type, okpo_from, mfo_from,
account_from, payee, okpo_to, mfo_to, account_to, receiver, distinct_kid,
D.NOTES, t.is_manual_rate, d.status, d.co_2_id, d.dog_2_id, d.account_1,
d.a_11, d.a_12, d.a_13, d.account_2, d.a_21, d.a_22, d.a_23
from
tbl_bank_list_det t,
tbl_Docs d
where
t.doc_id=d.doc_id(+)

----------

update V_BANKLISTDET
set DOC_HOV = :v2, DOG_1_ID = :v3, K_1_ID = :v4, CO_1_ID = :v10, ACCOUNT_2 = :v36
where rowid = :doa__rowid
returning rowid into :doa__rowid

----------

ORA-22816: Unsupported feature with RETURNING clause
 
In this case you need to set the UniqueFields property to the view columns (separated by semi colons) that uniquely identify a records in the view.
 
Back
Top