InterBase mit Arrays und FireDAC (Interbase with Arrays and FireDAC)
[SHOWTOGROUPS=4,20]
Matthias Eißing
14/4/2020
Для просмотра ссылки Войдиили Зарегистрируйся has been offering the possibility to use arrays since time immemorial.
What are arrays?
Arrays are one or more dimensional data stores of the same type within a column. These can be used with InterBase with all standard data types, except for BLOBs.
When should you use it / when not?
Arrays can Для просмотра ссылки Войдиили Зарегистрируйся quite Для просмотра ссылки Войди или Зарегистрируйся . But you should note when you should use them and when you should be better:
Arrays are created as extensions of CREATE TABLEor CREATE DOMAIN:
CREATE TABLE TBL_ARRAY
(
ID INTEGER,
TICTACTOE BOOLEAN[1:3, 1:3]
);
Here a Tic Tac Toe field is defined in a column.
With / with FireDAC it looks like this in the Delphi IDE:
(View from the data explorer)
Within an application. (Normal DBGrid and 3x3 DBCheckBox)
It should be noted that first the rows / rows and then the columns / columns in the array are run through. Для просмотра ссылки Войдиили Зарегистрируйся .
As of Berlin 10.1, the DBGrid also correctly displays an array!
Program access to the array elements
The array elements can be accessed directly via the 0-based elements. Alternating here:
Tbl_arrayTable.Edit;
Tbl_arrayTable.FieldByName('TICTACTOE[0]').Value := NOT Tbl_arrayTable.FieldByName('TICTACTOE[0]').AsBoolean;
What to pay attention to?
Unfortunately, the InterBase Console cannot display arrays:
My colleague Для просмотра ссылки Войдиили Зарегистрируйся also made a Для просмотра ссылки Войди или Зарегистрируйся about it (in English)
[/SHOWTOGROUPS]
Matthias Eißing
14/4/2020
Для просмотра ссылки Войди
What are arrays?
Arrays are one or more dimensional data stores of the same type within a column. These can be used with InterBase with all standard data types, except for BLOBs.
When should you use it / when not?
Arrays can Для просмотра ссылки Войди
- The data of the array are of the same type
- The data of the array are used as a logical (data belong together) and physical (storage in one column; under common transaction control) unit.
Arrays are created as extensions of CREATE TABLEor CREATE DOMAIN:
CREATE TABLE TBL_ARRAY
(
ID INTEGER,
TICTACTOE BOOLEAN[1:3, 1:3]
);
Here a Tic Tac Toe field is defined in a column.
With / with FireDAC it looks like this in the Delphi IDE:
(View from the data explorer)
Within an application. (Normal DBGrid and 3x3 DBCheckBox)
It should be noted that first the rows / rows and then the columns / columns in the array are run through. Для просмотра ссылки Войди
As of Berlin 10.1, the DBGrid also correctly displays an array!
Program access to the array elements
The array elements can be accessed directly via the 0-based elements. Alternating here:
Tbl_arrayTable.Edit;
Tbl_arrayTable.FieldByName('TICTACTOE[0]').Value := NOT Tbl_arrayTable.FieldByName('TICTACTOE[0]').AsBoolean;
What to pay attention to?
Unfortunately, the InterBase Console cannot display arrays:
My colleague Для просмотра ссылки Войди
[/SHOWTOGROUPS]
Последнее редактирование: