IBDAC Array Fields With Firebird

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wesleybobato
Posts: 19
Joined: Thu 13 Feb 2014 12:28

IBDAC Array Fields With Firebird

Post by wesleybobato » Tue 17 May 2016 16:46

Hi Support

I found a dozen problem in using Array Fields with IBDAC.

Firebird 2.5 and 3.0

I am adding a Link to Each problem and a description.

1-Access Violation After Disconnect.
https://www.dropbox.com/s/f2v9fw58ti2ih ... t.zip?dl=0

2-Copy and Paste Component
https://www.dropbox.com/s/1jb2ta5kvie97 ... t.zip?dl=0

3-Corrupt DFM
https://www.dropbox.com/s/7nryhe0iktb8o ... M.zip?dl=0

4-Nil and Invalid Handle
https://www.dropbox.com/s/j1zqh1ircqce3 ... d.zip?dl=0

5-Invalid ID From Identity Column After First Insert
https://www.dropbox.com/s/5l4geg93x37p5 ... t.zip?dl=0

6-Manager ID Manual
https://www.dropbox.com/s/oo7qnra9ju25w ... D.zip?dl=0

7-Add Query Fields
https://www.dropbox.com/s/x2akzc2d8hr35 ... s.zip?dl=0

8-Insert Query Access Violation
https://www.dropbox.com/s/1c9ptgz68i71t ... n.zip?dl=0

9-TField Array Index Access Violation
https://www.dropbox.com/s/h762784rv2bm1 ... n.zip?dl=0

10-TIBCLoader With Array Field Insert
https://www.dropbox.com/s/zx2z5jfixpilv ... t.zip?dl=0

11-not insert Value if Use Cast Type
if Use TypeCast SetItemAsInteger with Array Index not Insert Because Not Convert Values.

Example Here.
IBCSQL.SQL.Text := 'insert into IBDAC_ARRAYS (ID, CHAR_ARRAY) Values(:ID, :CHAR_ARRAY)';
IBCSQL.ParamByName('ID').AsInteger := 50;
with IBCSQL.ParamByName('CHAR_ARRAY').AsArray do begin
TableName := 'IBDAC_ARRAYS';
ColumnName := 'CHAR_ARRAY';
DbHandle := IBCSQL.Connection.Handle;
TrHandle := IBCSQL.Transaction.Handle;
GetArrayInfo;
SetItemAsString([1], '1'); //Here My Field is Array Integer. More use Type Cast, Not Insert Values em Array Field
SetItemAsString([2], '2');
SetItemAsString([3], '3');
end;
IBCSQL.Execute;

Videos Here by YouTube.
https://youtu.be/LP5NNsX69Jg
https://youtu.be/89bgJC3EizU
https://youtu.be/lje3CQrvVbg
https://youtu.be/TmW8JVo_0Mw
https://youtu.be/RxBThZoth08
https://youtu.be/iPRMCBE96gI
https://youtu.be/mHnkIYKIS5g
https://youtu.be/X0gr_7EZsOg
https://youtu.be/s9uWReXje1o
https://youtu.be/Xygj0lwjMec

Please Help-me Support
Sorry my Bad English.

Thanks.

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

Re: IBDAC Array Fields With Firebird

Post by ViktorV » Thu 19 May 2016 10:00

Thank you for the information. We have reproduced the issues described in paragraphs 1, 7, 8, 9 - and investigation is in progress. We will inform you when we have any results.
Paragraphs 2, 3, 10 - currently, TIBCLoader has no support for TIBCArray. If you want us to implement the feature, please post a suggestion at our user voice forum: https://devart.uservoice.com/forums/104 ... e-firebird If the suggestion gets a lot of votes, we will consider the possibility to implement it.
Paragraph 4 - IBCSQL.Transaction.Handle will equal nil until the transaction is started. To solve the issue, please insert before the line

Code: Select all

IBCSQL.SQL.Text := 'insert into IBDAC_ARRAYS (CHAR_ARRAY) Values(:CHAR_ARRAY)';
the following code:

Code: Select all

if not IBCSQL.Transaction.Active then
    IBCSQL.Transaction.StartTransaction;
Paragraphs 5, 6 - The error is not related to Identity Column in any way. You can make this sure by removing IDENTITY from field declaration. To solve the issue, please insert the line:

Code: Select all

CreateTemporaryArray;
after the line:

Code: Select all

GetArrayInfo;
in your code.
Paragraph 11 - When using these methods, values conversion occurs. You should use methods corresponding to the types used on table fields declaration. For example: for the Integer type use the SetItemAsInteger method, for Char (VarChar) - SetItemAsString.

Post Reply