Page 1 of 1

slow updates

Posted: Thu 19 Dec 2013 15:07
by sandy771
I have the following code whereby I am updating a number of records in table containing about 40,000 records. MessagesT is a TUniTable.

UniConnection1->StartTransaction();
for(int i=0; i<30; i++){
MessagesT->RecNo = tagged;
MessagesT->Edit();
MessagesT->FieldByName("Tag")->AsInteger = 1;
MessagesT->Post();
}
UniConnection1->Commit();

The code takes about 1 second to update each record which is too slow for my purposes. What can I do to speed this up?

Thanks

Re: slow updates

Posted: Thu 19 Dec 2013 16:00
by AndreyZ
Please specify the provider (TUniConnection.ProviderName) you are working with.

Re: slow updates

Posted: Thu 19 Dec 2013 16:02
by sandy771
Sorry Andrey

I am using sqlite and developing in Builder XE3

If you need anything else please advise.

Re: slow updates

Posted: Fri 20 Dec 2013 08:07
by AlexP
Hello,

We cannot reproduce the problem: the insertion code you provided works in less than fractions of a millisecond. Please make sure your DataSet, from which data is read, is not attached to visual components. Please specify your exact version of UniDAC, and send a sample and the DB file to alexp*devart*com