Combining OnUpdateRecord & options.batchsize?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Combining OnUpdateRecord & options.batchsize?

Post by Ludek » Thu 08 Oct 2015 09:01

Hi, i would like to have my own UpdateRecord handler (= do the standard action + something additional) and also apply the resulting changes grouped to some batch. Is there a way?
Thanks, Ludek.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Combining OnUpdateRecord & options.batchsize?

Post by azyk » Fri 09 Oct 2015 12:39

On using BATCH, after the TMSQuery.Execute method this BATCH is executed completely on the server. Therefore we can't control BATCH behavior during its execution on the server.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: Combining OnUpdateRecord & options.batchsize?

Post by Ludek » Mon 12 Oct 2015 11:41

I'm sorry, i don't understasnd now...
Other example:
Now, I can use my custom insert command in sqlinsert property of tmsquery (and applyupdates with updatebatchsize > 1 sends all of them in one batch to sql server). I would like to (slightly) customize the insert command for each saved record and save all the per-record-customized commands in one batch.

Just like sdac is connecting the same commands to one batch, it could perhaps connect MODIFIED commands to one batch(?)

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: Combining OnUpdateRecord & options.batchsize?

Post by Ludek » Mon 12 Oct 2015 11:51

perhaps beforeupdateexecute... I'll try it.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: Combining OnUpdateRecord & options.batchsize?

Post by Ludek » Mon 12 Oct 2015 13:16

Hmh, also hardly usable. this event contains already the connected command with all the parameteres of all the commands merged... Not simple to change the parameters and even harder to change something in the sql text... I even don't know, whether is changing of the sql text allowed...
Some better idea to do my task?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Combining OnUpdateRecord & options.batchsize?

Post by AlexP » Fri 16 Oct 2015 13:13

Please clarify, what do you want to modify: the SQL query text or parameter values?

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: Combining OnUpdateRecord & options.batchsize?

Post by Ludek » Wed 21 Oct 2015 08:58

sometimes this, sometimes that :)
but i gave up, i'm just setting updateaction := uaApplied and doing all the batch concatenation myself...

Post Reply