Page 1 of 1

AfterUpdateExecute/BeforeUpdateExecute of TOraQuery with single row refresh

Posted: Wed 02 Jan 2008 10:01
by keckhard
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.

TSmartQuery has the same behaviour

Posted: Thu 03 Jan 2008 10:10
by keckhard
hello support,
today i've tested the single row refresh of TSmartQuery unfortunately it has the same behaviour.
br, klaus eckhardt.

Posted: Thu 03 Jan 2008 10:37
by Plash
We could not reproduce the problem. Please send to odac*crlab*com a complete small sample that demonstrates the problem, including script to create database objects.

did you receive my update?

Posted: Tue 08 Jan 2008 07:50
by keckhard
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.

Posted: Tue 08 Jan 2008 09:08
by Plash
We have received your mail.

The bug is fixed in later builds of ODAC. You should upgrade ODAC to the last build.

Posted: Tue 08 Jan 2008 09:41
by keckhard
Hi Plash,
after receiving your mail, i've immediately tested the single row refresh with the newest version of odac. everything works fine now.
thx and br, klaus.