VirtualQuery + Batch

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AlainANTOCI
Posts: 21
Joined: Wed 07 Apr 2021 07:48

VirtualQuery + Batch

Post by AlainANTOCI » Sat 11 Dec 2021 07:05

Hi,

Is it possible to use batch with virutualTable. I've made the test below :

var
I: Integer;
begin
//---- Sql : Insert
VQ.Sql.Text := 'INSERT INTO P_EXPORT_DATA (USER_ID) VALUES (:USER_ID)';
VQ.Params[0].DataType := ftInteger;

//---- Par bloc de MAX_BATCH
VQ.Params.ValueCount := MAX_BATCH;

for I := 1 to 100 do
VQ.Params[0].AsInteger := I;

VQ.Execute(100,0);
end;

P_EXPORT_DATA VirtualTable with only on field Integer
VQ VirutalQuery

Line in bold throw exception :

Le projet MSat4.exe a déclenché la classe d'exeception EAssertionFailed avec le Message 'Muse be overrided (D:\projectsClone1\Delphi\Dac\Common\source\dbaccess.pas, ligne 3953)

The rest of code seems to works.

The same code with real table and UniQuery Works

I Use delphi XE 8 et Unidac 9.1.1. Projects are on drive D: but directory I've no directory called ProjectsClone1.

Regards.

AlainANTOCI
Posts: 21
Joined: Wed 07 Apr 2021 07:48

Re: VirtualQuery + Batch

Post by AlainANTOCI » Thu 16 Dec 2021 09:53

a simple code to reproduce the problem :

procedure TFichePrincipale.Button1Click(Sender: TObject);
var
TQ: TVirtualQuery;
RQ: TVirtualTable;
I: Integer;
begin
RQ := TVirtualTable.Create(nil);

try
RQ.AddField('USER_ID',ftInteger,0);

TQ := TVirtualQuery.Create(nil);

try
TQ.SourceDataSets.Add(RQ,'','P_EXPORT_DATA');

TQ.Sql.Text := 'INSERT INTO P_EXPORT_DATA (USER_ID) VALUES (:USER_ID)';
TQ.Params[0].DataType := ftInteger;

TQ.Params.ValueCount := 10; //---- Line in error

for I := 0 to 9 do
TQ.Params[0] .AsInteger := I + 1;

TQ.Execute(10);


finally
FreeAndNil(TQ);
end;

finally
FreeAndNil(RQ);
end;
end;

Compilation is ok, I use Delphi XE8, Oracle and Unidac 9.1.1 in a 32 bits project.

Regards

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: VirtualQuery + Batch

Post by MaximG » Wed 22 Dec 2021 13:20

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

Post Reply