I don't think ODBC provides any clear guidance.
It defines 2 distinct descriptor elements:

COLUMN_SIZE: the size in bytes
DISPLAY_SIZE: the size in characters

And PRECISION is only defined wrt numerics;
otherwise, the column descriptors only return OCTET_LENGTH
(aka byte length).

So I'm going to punt and return the byte length...
Maybe its time for a new bit of metadata,
OCTET_LENGTH, or DISPLAY_LENGTH
to sort all this out ?

BTW: is there a possible DBI API inconsistency ?

type_info() defines COLUMN_SIZE as the size in bytes;
but column_info() defines COLUMN_SIZE as size in chars.


Dean Arnold
Presicient Corp.
www.presicient.com

Reply via email to