Page 1 of 1
ZQuery ZUpdateSql
Posted: 17.11.2014, 09:17
by k1attila1
Hi
I have a problem but i can't solve it alone.
I use firebird with Zquery and ZUpdateSQL.
Everything works fine, but how can i get an errormessage if updatesql, deletesql statement can't executed, because somebody else deleted or modified the record.
Because i can't get errormessage and i can't read the affected rows number. ( = 0 )
thanks Attila
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 12:28
by EgonHugeist
Attila,
to be clear:
You want to have a ErrorMessage from FB if a reord was missing. Aren't you working with transactions?
So if i understand you correctly the TZUpdateSQL component does not raise an exception which bropably was raised by FB?
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 12:53
by k1attila1
Yes
ZQuery and ZTable work very well
But if i use ZQuery with ZUpdateSQL i can't get any message, errorcode, '0 rows updated' etc.
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 12:58
by EgonHugeist
Ok than you're expecting zeos is missing validating the update count.
Not a problem, i'll check this!
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 13:01
by k1attila1
Sorry i have forgotten
I think FB doesn't raise exception when we can't update or delete a record (which were deleted or modified before by another user), i think only
send a '0 rows affected message'
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 17:12
by EgonHugeist
Attila,
missing ValidateUpdateCount added.
Patch done R3493 \testing-7.2 (SVN)
Thanks for the hint!
Note you can improve same by adding 'ValidateUpdateCount=True' to the TZDataSet-Component.
Re: ZQuery ZUpdateSql
Posted: 17.11.2014, 18:18
by k1attila1
Thank you very much for the fast action.
Attila
Re: ZQuery ZUpdateSql
Posted: 20.11.2014, 14:55
by alexs75
Is it possible to disable this check, if Zquery.CashedUpdate = true?
Re: ZQuery ZUpdateSql
Posted: 29.11.2014, 18:33
by EgonHugeist
@Alex
Note you can improve same by adding 'ValidateUpdateCount=True' to the TZDataSet-Component.
You can also disable this by setting the value to False.
Re: ZQuery ZUpdateSql
Posted: 02.12.2014, 12:37
by alexs75
In the CachedUpdate = true, this test should only work when calling ApplyUpdate. Now it works after calling Post.