Subject Cannot get correct field length when using collation in domain
Author sir_wally_lewis
We are now using the feature in Firebird that allows numerical sorting of varchar fields ( see below )

however now the length of these fields in RDB$FIELDS.RDB$FIELD_LENGTH is now 4 times the real size of the field. size 80 when domain length is really only 20. This deceives our application into beleiving it can put larger information in than it really can. What I need to know is the true field length from an external perspective.

How can I solve this?

ie,

CREATE COLLATION UNICODE_NUM FOR UTF8 FROM UNICODE ''NUMERIC-SORT=1'';

CREATE DOMAIN T_CODE AS
VARCHAR(20) CHARACTER SET UTF8
COLLATE UNICODE_NUM;

Kind Regards,

Robert.