Wrong length of inserted data in batch operations
Posted: Tue 29 Mar 2022 08:28
Hi,
I have unidac 9.1.1, I'm trying to batch insert using ODBC provider to Actian Zen.
My problems is that data is stored with wrong length, typically length of first record value
hakuasiakasnro is an integer , hakusana is varchar(40)
This is the codesite output of parameters
And this is output of query select hakuasiakasnro, hakusana from ashakuterm where hakuasiakasnro=8
If I do it without batch, it works ok.
I have unidac 9.1.1, I'm trying to batch insert using ODBC provider to Actian Zen.
My problems is that data is stored with wrong length, typically length of first record value
Code: Select all
aq.sql.Text := 'insert into ashakuterm (hakuasiakasnro, hakusana) values (:n, :s)';
aq.params[0].DataType := ftInteger;
aq.params[1].DataType := ftString;
aq.Params.ValueCount := apuLista.Count; //apuLista=tstringlist
for i := 0 to apuLista.count -1 do
begin
aq.Params[0][i].AsInteger := aasiakasnro;
aq.params[1][i].asstring := apuLista.strings[i];
codesite.send('%d / %s',[aasiakasnro, apulista.Strings[i]);
end;
aq.execute(apuLista.count);
This is the codesite output of parameters
Code: Select all
8 / 8
8 / SKJ SYSTEMS LTD OY
8 / SKJ
8 / SYSTEMS
8 / LTD
8 / OY
8 / KUOPIO
8 / MÖTTÖNEN MAKE
8 / MÖTTÖNEN
8 / MAKE
8 / PENTTI HIRVONEN
8 / PENTTI
8 / HIRVONEN
Code: Select all
8 8
8 S
8 L
8 O
8 K
8 M
8 P
8 H