[fpc-pascal] SqlDB TSQLQuery sqoAutoApplyUpdates does not work with ExecSQL
Andi Friess
friess at gmx.at
Fri Dec 16 09:30:44 CET 2022
Am 16.12.2022 um 08:50 schrieb Michael Van Canneyt via fpc-pascal:
>>> ApplyUpdates as you use it, is not the correct solution.
>>> Once more: ApplyUpdates ONLY makes sense after changing data and doing a
>>> Post. Any other use does not make any sense.
>>>
>> Data is changed by the SP. But this is done in a simpy open in the
>> query. No insert or delete of the Query is activated. It must be done
>> with open, because a resultset is returned. This can not be handled by
>> ExecSQL (maybe ia wrong).
>
> "after changing data" must be understood as 'you change data in the
> dataset', i.e. a post or delete operation on the dataset.
>
> TDataset cannot know what happens behind the scenes in a stored procedure.
But it opens a transaction without close it.
If i look before fire the open, the transaction is inactive, after the
open it is active and after the close it is still active.
This is not expected by me. The query creates a 'dangling' transaction.
>
> Since you are not doing a Post(), ApplyUpdates does not apply, nor does
> sqoAutoCommit. Both are relevant only afer a Post() or Delete.
>
> I will add some remarks to the documentation to make this more clear.
Thanks,
now it will be more clear.
But will it be better to add a TStoredProcedure to the SQLdb Components
as other componentsset do. This can better fullfill the special
requirements of Stored Procedures and Functions.
I know the work, but if "someone" make it, will it be accepted ? And yes
i know the freeTDS components have (some) limitation specially with SP
and returnvalues.
>
> Michael.
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal-PD4FTy7X32k2wBtHl531yWD2FQJk+8+b at public.gmane.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list