hello,
we use TOraQuery (Odac for Delphi 2007, version 6.10.1.10 02.08.07) to query and manipulate data. after an insert or update we use single row refresh for refreshing the grid belonging to the dataset. to specify the query parameters for the single row refresh we use the BeforeUpdateExecute event :
if (StatementTypes = [stRefresh]) then begin Params.ParamByName('ARTKMK_ID').AsInteger:=qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').AsInteger;
qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').clear;
end;
the ARTKMK_ID mentioned above is preserved during AfterUpdateExecute:
if (StatementTypes [stRefresh]) then qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').AsInteger:=Params.ParamByName('ARTKMK_ID').AsInteger;
ARTKMK_ID is a returning value from the insert/update statement and is the id of the newly inserted or updated row.
this works always fine for the first inserted or updated row. but if i try to insert/update a second record (immediatley after inserting/updating the first record), the AfterUpdateExecute is not called and the BeforeUpdateExecute is called only one times (instead of one times for StatementTypes = [stInsert] and one times for StatementTypes = [stRefresh]). thus, for the second insert/update the id of the new record is not preserved and even it would be reserved, the parameter for the single row refresh is not set and the refresh fails because it finds more than one record.
after executing a full refresh of TOraQuery, single row refresh for inserting/updating a row works one times and fails again for the second row.
have i misunderstood the functionality of AfterUpdateExecute/BeforeUpdateExecute or is this a bug?
thx and br, klaus eckhardt.
AfterUpdateExecute/BeforeUpdateExecute of TOraQuery with single row refresh
TSmartQuery has the same behaviour
hello support,
today i've tested the single row refresh of TSmartQuery unfortunately it has the same behaviour.
br, klaus eckhardt.
today i've tested the single row refresh of TSmartQuery unfortunately it has the same behaviour.
br, klaus eckhardt.
did you receive my update?
Hi Plash,
last week i sent an update with a demo project, create scripts for database objects and a test-scenario regarding the problem with the single row refresh to [email protected]. i just want to know if you have received my email and if you are now able to reproduce the problem.
thx and br, klaus.
last week i sent an update with a demo project, create scripts for database objects and a test-scenario regarding the problem with the single row refresh to [email protected]. i just want to know if you have received my email and if you are now able to reproduce the problem.
thx and br, klaus.