batch update 9.6.20 c++ builder

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

batch update 9.6.20 c++ builder

Post by albourgz » Tue 22 Sep 2015 12:48

From your (delphi) example the new Batch Update Feature tells:

Code: Select all

Query1.Params[0].DataType:=ftInteger;
Query1.Params[1].DataType:=ftInteger;
  
for i := 0 to Query1.Params.ValueCount - 1 do begin
    Query1.Params[0][i].AsInteger := i + 1;
    Query1.Params[1][i].AsInteger := i + 2000 + 1;
  end;
In c++ builder (xe8 pro), I can't use it .

Code: Select all

Query1->Params[0]->DataType:=ftInteger;
cannot be compiled. I have to write

Code: Select all

Query1->Params->Items[0]->DataType=ftInteger;
Hoping the effect is the same????

Also,

Code: Select all

Query1->Params[1][i]->AsInteger = i + 1;
raises an exceptionat runtime. I tried [1] but I also get exception.
I tried also

Code: Select all

    Query1->Params[i].Items[1]->AsInteger=i+1;
but it also fails.

Is it feasable to use this feature in c++?


KR,
Alain

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: batch update 9.6.20 c++ builder

Post by AlexP » Wed 23 Sep 2015 05:14

Hello,

Yes, this feature is supported in C++ Builder. You can use the following code:

Code: Select all

	OraQuery1->Params->ValueCount = 2;
	OraQuery1->Params->Items[0]->DataType = ftInteger;
	OraQuery1->Params->Items[0]->ParamType = ptInput;

	OraQuery1->Params->Items[0]->Values[0]->AsInteger = 1;
	OraQuery1->Params->Items[0]->Values[1]->AsInteger = 2;

	OraQuery1->Execute(2);

Post Reply