Page 1 of 1

How do the TZQuery display fields array as blob in Firebird?

Posted: 30.04.2013, 16:51
by jepafi
How to configure that automatically displays the TZquery in a TDBGrid a field array the Firebird as blob?

For example, the IBExpert and Flamerobin make it transparent to the user.

Database: EMPLOYER
Query: SELECT * FROM JOB
Erro in "ZQuery1.Open": Cannot access blob record in column 8 with type String
Column 8: LANGUAGE_REQ is a array field

Posted: 01.05.2013, 11:00
by marsupilami
Hello jepafi,

I think that neither Delphi nor Lazarus have support for displaying Array fields easily in DBGrids.
You might want to consider to use the OnGetText and OnSetText events of the Field to achieve something that works similar to IBExpert and Flamerobin.
Best regards,

Jan

Posted: 04.05.2013, 11:14
by Fuat
Hello jepafi
It seem's to be a BUG in Zeos. Because the Columm 8 ist NOT A BLOB field.

The EMPLOYEE.FDB or EMPLOYEE.GDB are included as Test-Data from Firebird/Intebase.
So they should be Checked From the Zeos Lib - Team.

I am gettin the error even if the Field JOB_REQUIREMENT ( That's the BLOB Field ) is noch in the Query.

Structure of the Table: JOB

CREATE TABLE JOB (
JOB_CODE JOBCODE NOT NULL,
JOB_GRADE JOBGRADE NOT NULL,
JOB_COUNTRY COUNTRYNAME NOT NULL,
JOB_TITLE VARCHAR(25) NOT NULL,
MIN_SALARY SALARY NOT NULL,
MAX_SALARY SALARY NOT NULL,
JOB_REQUIREMENT BLOB SUB_TYPE 1 SEGMENT SIZE 400,
LANGUAGE_REQ VARCHAR(15)[5]);

QUERY: ( FOR ALL FIELDS )
SELECT FIRST 1000 JOB_GRADE, MIN_SALARY, MAX_SALARY, JOB_CODE, JOB_COUNTRY, JOB_TITLE, LANGUAGE_REQ, JOB_REQUIREMENT FROM JOB

The Error-Message:
Cannot Acces blob record in column 7 with type String.

QUERY 1: ( Without the BLOB field JOB_REQUIREMENT )

SELECT FIRST 1000 JOB_GRADE, MIN_SALARY, MAX_SALARY, JOB_CODE, JOB_COUNTRY, JOB_TITLE, LANGUAGE_REQ FROM JOB

The Error-Message:
Cannot Acces blob record in column 7 with type String.

This is the SAME EROR with and without the BLOB_FIELD!!!

In the next SQL-Statement i took the Array-Field LANGUAGE_REQ away and put the BLOB JOB_REQUIREMENT in !

SELECT FIRST 1000 JOB_GRADE, MIN_SALARY, MAX_SALARY, JOB_CODE, JOB_COUNTRY, JOB_TITLE, JOB_REQUIREMENT FROM JOB

Now the Error ist gone!

The Problem is not the BLOB, it is the Array Field.
The fired Error-Message is wrong....

Greatings
Fuat

I am working with Lazarus v1.0, Delpi XE3 ...

Posted: 16.06.2013, 00:07
by EgonHugeist
Fuat,

there is something missing, currently. We could handle a patch with Delphi, if we would create a NestedDataSet virtually. But there is nothing possible with the current FPC. No way...

I could have a look. But isn't a different select possible too? Something untested like this:

"select LANGUAGE_REQ[1] as LANGUAGE_REQ1, LANGUAGE_REQ[2] as LANGUAGE_REQ2 from JOB;" ??

Posted: 18.06.2013, 13:10
by miab3
@EgonHugeist, @Fuat

"select LANGUAGE_REQ[1] as LANGUAGE_REQ1, LANGUAGE_REQ[2] as LANGUAGE_REQ2 from JOB;"

It works.

Michal