Page 1 of 1

ZMemTable and array fields bug

Posted: 24.04.2022, 09:18
by stoffman
Hi,

A query I work on has an array field in a results set. After copying it to ZMemTable the gird I'm using to present the data returns with the following error:
"EZSQLException: Cannot access blob record in column 4 with type String". This error doesn't happen when I'm presenting the data directly from the original ZReadOnlyQuery. (I used the ZMemTable1.CloneDataFrom(ZReadOnlyQuery1) to copy the data)

(I'm using PostgreSQL)

I think this bug has the same roots as previous post I made regarding array columns. But maybe it is something specific to ZMemTable.

Is there away to clone the data exactly as is?

Thanks,

Re: ZMemTable and array fields bug

Posted: 24.04.2022, 11:38
by marsupilami
stoffman wrote: 24.04.2022, 09:18 A query I work on has an array field in a results set. After copying it to ZMemTable the gird I'm using to present the data returns with the following error:
"EZSQLException: Cannot access blob record in column 4 with type String". This error doesn't happen when I'm presenting the data directly from the original ZReadOnlyQuery. (I used the ZMemTable1.CloneDataFrom(ZReadOnlyQuery1) to copy the data)

(I'm using PostgreSQL)

I think this bug has the same roots as previous post I made regarding array columns. But maybe it is something specific to ZMemTable.
This bug most probably has the same roots. When using TZReadOnlyQuery, Zeos internally will use TZPostgreSQLResultSet which operates on the PostgreSQL API directly. TZMemTable.CloneDataFrom will try to copy the data into a TZCachedResultSet - which in turn will trigger the error.
stoffman wrote: 24.04.2022, 09:18 Is there away to clone the data exactly as is?
Not in this combination since it requires to copy the data from libpq representation into Zeos internal representation.

Re: ZMemTable and array fields bug

Posted: 24.04.2022, 17:28
by stoffman
I'm not sure that the case. CloneDataFrom doesn't trigger the error. Only when I present ZMemTable in the grid. So the cloning part works fine.

Re: ZMemTable and array fields bug

Posted: 27.04.2022, 09:38
by marsupilami
As mentioned here: Could you please check if BinaryWireResultMode=False enabley you to work with array fields the way you want to work with them?