Re: Big bad bug in Online 7.2 UC2?
Posted in 1997
Topics: Data Types & Schema Design
Dirk Fromhein wrote:
>
> Using the sample stores7 database and the following SQL:
>
> select colname, coltype, collength from informix.syscolumns,
> informix.systables where informix.syscolumns.tabid =
> informix.systables.tabid and tabname = 'catalog'>
> You get:
> colname coltype collength
>
> catalog_num 262 4
> stock_num 257 2
> manu_code 256 3
> cat_descr 12 56
> cat_picture 11 56
> cat_advert 13 16895
>
> Ummm... cat_advert is a varchar(255) why is the size 16895?
>
> Or am I just completely not understanding this?
You are just completely not understanding this. :-) Well, you DID ask.
This is actually a RTFM, but here goes. The max-size and min-space
values are encoded in the collength field using the following:
collength = (min-space * 256) + max-size
So it looks like a VARCHAR(255,65)
DECIMAL, MONEY, DATETIME & INTERVAL values are also encoded in a
similar form.
Oh, and don't claim OnLine or ANY product has bugs in your subject line
until proven or confirmed. :-)
Hope that helps,
--
Mark.
+------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |
| The Informix FAQ is at http://www.iiug.org |
|mailto:marks@west.co.za +-----------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work, force it! |
|Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!|
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+-----------------------------------------+