Can TCustomClientDataset apply updates in batch mode?

I have a DB Express TSimpleDataset connected to a Firebird database. I just added a few thousand rows of data to the dataset, and now it's time to call ApplyUpdates.

Unfortunately, this leads to several thousand database hits when it tries to execute INSERTeach row separately. This is a little disappointing. What I really would like to see is a data set that creates a single transaction with several thousand statements INSERTin it and sending it all at once. I could install this myself if I had to, but first I would like to know if there is any method for it built into the dataset or DBX infrastructure.

+3
source share
1 answer

I don't know if this is possible with TSimpleDataset (it has never been used), but of course you can use it if you use TClientDataset + TDatasetProvider + <put db data dataset here>. You can write BeforeUpdateRecord to handle the application process yourself. In principle, it allows you to bypass the standard application process, access the deltas of the data set with the changes made to the records, and then use your own code and components to apply the changes to the database. For example, you can call stored procedures to modify data, etc.

, " DML", " " . ( "" AFAIK ), "n" INSERT. INSERT ( , ) , , , , , AFAIK dbExpress/Datasnap - BeforeUpdateRecord, .

0

All Articles