The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
procedure TForm1.Button1Click(Sender: TObject);
var
indice : cardinal;
price, taxes : Currency;
begin
price := 0;
taxes := 0;
with ZQuery1 do
begin
Connection := ZConnection1;
Active := false;
SQL.Clear;
SQL.Add('insert into sometable (column_string1, column_string2, column_currency1, column_currency2)');
SQL.Add('values (:column_string1, :column_string2, :column_currency1, :column_currency2)');
Params.BatchDMLCount := 100;
for indice := 0 to Pred(Params.BatchDMLCount) do
begin
Params[0].SQLType := stUnicodeString;
Params[1].SQLType := stUnicodeString;
Params[2].SQLType := stCurrency;
Params[3].SQLType := stCurrency;
Randomize;
price := Random(1001) / 100;
taxes := 5.0;
Params[0].AsUnicodeStrings[indice] := 'array ' + IntToStr(indice);
Params[1].AsUnicodeStrings[indice] := 'product arraydml ' + IntToStr(indice);
Params[2].AsCurrencys[indice] := price;
Params[3].AsCurrencys[indice] := taxes;
end;
ExecSQL;
ShowMessage('Rows affected ' + IntToStr(RowsAffected));
end;
end;
When I run the above code, I get a 'Invalid Variant-Type for String-Array binding!' exception on line 4303 of ZDbcStatement unit.
What I am doing wrong?
Thank you!
Last edited by brunodelmondes on 08.10.2021, 12:44, edited 2 times in total.
brunodelmondes wrote: ↑06.10.2021, 14:27
I'm facing a trouble to use BatchDML on Delphi 2010, Zeos SVN 7683 and Firebird 2.1.7.
I am not sure, if we support Batch DML on this version of Firebird because Firebird introduced its Batch API with a later version. Not sure if that was in version 3 or version 4. But maybe we do something with execute block there to simulate it. Does that also happen on Firebird 4? Maybe you could try that using an embedded server?
For the rest I will have to look. Might take a bit of time.
I am not sure, if we support Batch DML on this version of Firebird because Firebird introduced its Batch API with a later version. Not sure if that was in version 3 or version 4.
Well, I'm also not sure about this, but Zeos recognizes FB 2.1 with support for BatchDML, see the screenshots below.
Before the Loop, same " Invalid Variant-Type for String-Array binding! " error... without it occurs " Unsupported parameter type, SQLType: stCurrency/stUnicodeString. " error.
These lines do not compile at all for me:
Params[0].SQLType := stUnicodeString;
Params[1].SQLType := stUnicodeString;
Params[2].SQLType := stCurrency;
Params[3].SQLType := stCurrency;
These lines do not compile at all for me:
Params[0].SQLType := stUnicodeString;
Params[1].SQLType := stUnicodeString;
Params[2].SQLType := stCurrency;
Params[3].SQLType := stCurrency;