Subject | Re: [firebird-support] Right-padded char fields? |
---|---|
Author | Olivier Mascia |
Post date | 2008-09-01T15:50:18Z |
Le 01-sept.-08 à 17:24, Ivan Prenosil a écrit :
byte-length) is needed. But why would the engine return description
of its output if it's to ask user to please run additional query
against the metadata tables to "learn more"?
For instance, if you run a query building a CHAR(x) result (as part of
a CAST for instance) and not directly derived from a table column,
where would you dynamically look at to find the declared character
length if the engine does not return it through its row descriptors
(XSQLDA/XSQLVAR)?
Interface layers do not have final application knowledge inside, they
must be able to act correctly on dynamic data description. Sure a
layer may decode UTF8 to find out how many characters are in there and
cut where appropriate based on the binary length cut in fourths
because we have learned some other way the data is in UTF8... But this
adds some complexity on the layer (requirement to understand the
encoding) just to deliver the data correctly to the client application.
--
Olivier Mascia
T.I.P. Group S.A.
http://www.tipgroup.com
> E.g. if you need to display data in tabular form, application needsI perfectly agree with you that finding the number of characters (not
> to find out
> number of characters, not blindly use the "length" directly from data.
byte-length) is needed. But why would the engine return description
of its output if it's to ask user to please run additional query
against the metadata tables to "learn more"?
For instance, if you run a query building a CHAR(x) result (as part of
a CAST for instance) and not directly derived from a table column,
where would you dynamically look at to find the declared character
length if the engine does not return it through its row descriptors
(XSQLDA/XSQLVAR)?
Interface layers do not have final application knowledge inside, they
must be able to act correctly on dynamic data description. Sure a
layer may decode UTF8 to find out how many characters are in there and
cut where appropriate based on the binary length cut in fourths
because we have learned some other way the data is in UTF8... But this
adds some complexity on the layer (requirement to understand the
encoding) just to deliver the data correctly to the client application.
--
Olivier Mascia
T.I.P. Group S.A.
http://www.tipgroup.com