6.2.7- Can not access a DML array as a single value

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ecosoft.it
Posts: 12
Joined: Thu 01 Dec 2011 14:36
Contact:

6.2.7- Can not access a DML array as a single value

Post by ecosoft.it » Mon 14 Sep 2015 17:11

I have tried your sample:
http://blog.devart.com/using-batch-oper ... nents.html

But I have received this error: "Can not access a DML array as a single value"

I have tried INSERT and DELETE code with TUniQuery with SQLServer 2008, Firebird 2.52 and XE8/10 Seattle

Code: Select all

procedure TForm43.ButtonInsClick(Sender: TObject);
var
  i: Integer;
begin
  // describe the SQL query
  Query1.SQL.Text := 'INSERT INTO BATCH_TEST VALUES (:ID, :F_INTEGER, :F_FLOAT, :F_STRING, :F_DATE)';

  // define the parameter types passed to the query :
  Query1.Params[0].DataType := ftInteger;
  Query1.Params[1].DataType := ftInteger;
  Query1.Params[2].DataType := ftFloat;
  Query1.Params[3].DataType := ftWideString;
  Query1.Params[4].DataType := ftDateTime;

  // specify the array dimension:
  Query1.Params.ValueCount := 1000;

  // populate the array with parameter values:
  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;
    Query1.Params[2][i].AsFloat := (i + 1) / 12;
    Query1.Params[3][i].AsString := 'Values ' + IntToStr(i + 1);
    Query1.Params[4][i].AsDateTime := Now;
  end;

  // insert 1000 rows into the BATCH_TEST table
  Query1.Execute(1000);
  ShowMessage('ok');
end;

procedure TForm43.ButtonDelClick(Sender: TObject);
var
  i: Integer;
begin
  // describe the SQL query
  Query1.SQL.Text := 'DELETE FROM BATCH_TEST WHERE ID=:ID';

  // define parameter types passed to the query:
  Query1.Params[0].DataType := ftInteger;

  // specify the array dimension
  Query1.Params.ValueCount := 1000;

  // populate the arrays with parameter values
  for i := 0 to 1000 - 1 do
    Query1.Params[0][i].AsInteger := i + 3000 + 1;

  // delete 1000 rows from the BATCH_TEST table
  Query1.Execute(1000);
end;

Thanks
Alessandro

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

Re: 6.2.7- Can not access a DML array as a single value

Post by MaximG » Tue 15 Sep 2015 13:08

We have tested UniDAC on using Batch operations with InterBaseUniProvider and SQLServerUniProvider on Delphi 10 Seattle - and haven't detected any problems.
Please pay attention, we have corrected some inaccuracy in our blog about Batch operations. Try to reproduce the batch samples from http://blog.devart.com/using-batch-oper ... nents.html once again. Send the complete sample reproducing the error to maximg*devart*com

ecosoft.it
Posts: 12
Joined: Thu 01 Dec 2011 14:36
Contact:

Re: 6.2.7- Can not access a DML array as a single value

Post by ecosoft.it » Tue 15 Sep 2015 15:45

I had added a TUniSQLMonitor component on my sample.
If use TUniSQLMonitor.Active = true the my application raise the exception!
If not active all it working.

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

Re: 6.2.7- Can not access a DML array as a single value

Post by AlexP » Wed 16 Sep 2015 07:26

We have already fixed the issue with SQLMonitor. We will upload the fixed version tomorrow.

ecosoft.it
Posts: 12
Joined: Thu 01 Dec 2011 14:36
Contact:

Re: 6.2.7- Can not access a DML array as a single value

Post by ecosoft.it » Tue 22 Sep 2015 13:31

I have installed the 6.2.8 version and I have the same problem with TUniSQLMonitor.Active = true.

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

Re: 6.2.7- Can not access a DML array as a single value

Post by AlexP » Wed 23 Sep 2015 08:27

We have checked this behavior again. SQLMonitor works with Batch operations correctly on the latest version. Please make sure there are no old *.dcu, *.bpl, *.pas files of UniDAC, and *.dcu files of your application.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: 6.2.7- Can not access a DML array as a single value

Post by FredS » Wed 23 Sep 2015 21:39

AlexP wrote:We have checked this behavior again. SQLMonitor works with Batch operations correctly on the latest version. Please make sure there are no old *.dcu, *.bpl, *.pas files of UniDAC, and *.dcu files of your application.
Hi Alex,

I can confirm this using W10 PRO and XE8. When I turned on the SQL Monitor for another issue I began getting this exact error instead of an Access Violation as per: http://forums.devart.com/viewtopic.php?f=28&t=32505

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

Re: 6.2.7- Can not access a DML array as a single value

Post by AlexP » Thu 24 Sep 2015 08:26

The AV described in your post is not related to SQLMonitor.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: 6.2.7- Can not access a DML array as a single value

Post by FredS » Thu 24 Sep 2015 17:06

OK, but the error changes depending on TUniSQLMonitor Active.

Code: Select all

TUniSQLMonitor.Active := False
Project PA.exe raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.
---------------------------

Code: Select all

TUniSQLMonitor.Active := True
Project PA.exe raised exception class Exception with message 'Can not access a DML array as a single value'.
---------------------------

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: 6.2.7- Can not access a DML array as a single value

Post by ViktorV » Fri 25 Sep 2015 12:03

FredS wrote:OK, but the error changes depending on TUniSQLMonitor Active.

Code: Select all

TUniSQLMonitor.Active := False
Project PA.exe raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.
---------------------------

Code: Select all

TUniSQLMonitor.Active := True
Project PA.exe raised exception class Exception with message 'Can not access a DML array as a single value'.
---------------------------
Thank you for the information. We have reproduced the problem. We will fix this bug till the next build of UniDAC.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: 6.2.7- Can not access a DML array as a single value

Post by FredS » Fri 25 Sep 2015 16:57

ViktorV wrote:We will fix this bug till the next build of UniDAC.
I would appreciate an overnight build when this is done. Can resubmit credentials if needed.

thanks

Fred

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: 6.2.7- Can not access a DML array as a single value

Post by FredS » Mon 12 Oct 2015 17:52

ViktorV wrote: Thank you for the information. We have reproduced the problem. We will fix this bug till the next build of UniDAC.
Do we have an ETA for this yet?

thanks

Fred

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: 6.2.7- Can not access a DML array as a single value

Post by ViktorV » Tue 13 Oct 2015 09:59

We can send you a night build including the fix. For this, please send your license number for UniDAC and the IDE version to viktorv*devart*com.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: 6.2.7- Can not access a DML array as a single value

Post by FredS » Mon 19 Oct 2015 20:04

ViktorV wrote:We can send you a night build including the fix. For this, please send your license number for UniDAC and the IDE version to viktorv*devart*com.
I've sent you two email with no reply?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: 6.2.7- Can not access a DML array as a single value

Post by ViktorV » Tue 20 Oct 2015 10:22

We have sent you a night build of UniDAC including the fix to your e-mail.

Post Reply