Subject Re: Array, the last Samurai or Mission impossible ?
Author hvlad
--- In firebird-support@yahoogroups.com, "stoneoldrock" wrote:
>
> Hi, all (and Vlad)
>
> I was here to ask help about BLOB, and it helped a lot.
>
> Now I have developed a function which can load multiple (different) files into multiple blob columns by INSERT or UPDATE with a single function call, after that help, thanks.
>
> Encouraged by this I am going to explore the array, an abundant and lonely field seldom attended by anyone( but still useful).
>
> The following codes are NOT working, would anyone like to point out where is wrong?
...
> the table with array column is as:
>
> table name: TBL_D
> column name: FLD_ARRA CHAR(20)[5]
>
> SQL:UPDATE TBL_D SET FLD_ARRA = ? where FLD_SML = 100
>
> char *arr_buf[] = { "AAA", "AAA", "AAA", "AAA", "AAA" };

For CHAR(20) data type you must supply buffer of 20 bytes per item.
Or you could leave this C-data as is but modify data type at array
descriptor returned by Firebird - try to set it to the blr_cstring
(it should be blr_text when you retrieve it from engine). I don't know
if this trick will work. If not - supply correct CHAR(20) data.

Hope this helps,
Vlad