There is a behaviour I don't understand using c++ builder 10.3.2/ unidac 8.3.2 / 32 bits vcl. (issue is the same with unidac 8.0.1), using batch updates.
I have to insert lots of rows in a table, don't know how much, so decided to insert by batches of 100. Query is a simple "insert into table values (:1,;2)"
So I set q->Params->ValueCount=100.
Each time I have 100 records, I run
Code: Select all
// in insert procedure
q->Params->Items[0]->Values[i]->AsInteger=p1;
q->Params->Items[1]->Values[i]->AsString=p2;
if (i==100) {
q->Execute();
q->Params->ValueCount=100;
i=0;
}
and restart populating the array
And the last time (<100 values populated) I run
Code: Select all
if (i>0) {
q->Execute(i);
}
Problems:
* it seems Execute() doesn't insert 100 values although 100 parameter values are given. Is it right?
* to avoid the issue I tried to set ValueCount to 100000. I got an out of memory exception at execute(i);
The computer has 16GB ram, but it is 32 bits. Even if the app receives 3Gb without swap, 3GB/100000, it means 30KB per row, which seems to be a lot to me. Is it normal that it crashes?
Thanks.