Walter wrote:

Somebody knows how to use arrays?

I can write it:

CREATE DOMAIN D_ARRAY_1 AS VARCHAR(10)[12];

but when in a stored procedure I write:

DECLARE VARIABLE MyArray TYPE OF D_ARRAY_1;

appears the message:

"Usage of domain or TYPE OF COLUMN of array type in PSQL."

So, is impossible to use arrays in stored procedures?

Where I can use arrays?

Do you have some example?

Dmitry Kuzmenko answers:

Do not use arrays, ever.

Arrays are stored "inside" blobs, so, it's simpier to use blob for your client array data. Because the only thing you can do in SQL/DML with arrays is selecting array element. Insert and update you can do only at client side, writing array as a blob. Or, you may use embedded sql preprocessor gpre, but I think you will not like that idea

But, if you are just curious, check procedures in employee.fdb and InterBase's documentation.

P.S. someone thinks that arrays are better than blobs, because they can update only part of array, not the whole array.

But, this is not true - new array is written the whole, same as if you will try to modify 1 byte in 1mb blob - 1 mb will be written.

Like this post? Share on: TwitterFacebookEmail


Related Articles


Author

Firebird Community

Published

Category

Gems from Firebird Support list

Tags