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.
VirtualQuery + Batch
-
- Posts: 21
- Joined: Wed 07 Apr 2021 07:48
Re: VirtualQuery + Batch
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
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
Re: VirtualQuery + Batch
Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.