Re: column length (collength)
Posted in 2013
Thanks Jonathan, Art and Jack! Very good! Frank On Mon, Jan 28, 2013 at 7:43 PM, Jonathan Leffler < jonathan.leffler@gmail.com> wrote: > 3594 decimal is 0x0E0A (hex). > > The 0E means the total length is 14 digits, which translates to (14/2 + 1) > = 8 bytes on disk. The second 0 indicates the start field is YEAR. The A > indicates the end field is SECOND. You have a DATETIME YEAR TO SECOND. > > The encoding is slightly different, but closely related, for INTERVAL > types. > > If you've got ESQL/C and understand C, the datetime.h header will show > TU_YEAR = 0 and TU_SECOND = 10, which is where the last two hex digits come > from. The length is a modestly complex formula - see the TU_DTENCODE() > macro and relatives; TU_IENCODE for INTERVAL types. > > > On Mon, Jan 28, 2013 at 2:03 PM, FRANK <yunyaoqu@gmail.com> wrote: > >> Just make sure. >> I have a column defined as, >> ingest_dt datetime year to second not null ; >> Its info in syscolumns shows, >> colname ingest_dt >> tabid 267 >> colno 7 >> coltype 266 >> collength 3594 >> colmin >> colmax >> extended_id 0 >> seclabelid 0 >> colattr 0 >> So, physically, the ingest_dt column might occupy 3594 bytes in disk for >> a row? >> I doubt this. >> Thanks, >> Frank >> >> On Sat, Jan 26, 2013 at 6:35 PM, Art Kagel <art.kagel@gmail.com> wrote: >> >>> The values for the parts of the qualifiers are found in the header file >>> datetime.h in $INFORMIXDIR/incl/esql along with macros to extract the >>> values. >>> >>> Art >>> >>> Art S. Kagel >>> Advanced DataTools (www.advancedatatools.com) >>> Blog: http://informix-myview.blogspot.com/ >>> >>> Disclaimer: Please keep in mind that my own opinions are my own opinions >>> and do not reflect on my employer, Advanced DataTools, the IIUG, nor any >>> other organization with which I am associated either explicitly, >>> implicitly, or by inference. Neither do those opinions reflect those of >>> other individuals affiliated with any entity with which I am affiliated nor >>> those of the entities themselves. >>> >>> >>> On Thu, Jan 24, 2013 at 7:35 AM, <tomcaml@gmail.com> wrote: >>> >>>> Thank you much >>>> _______________________________________________ >>>> Informix-list mailing list >>>> Informix-list@iiug.org >>>> http://www.iiug.org/mailman/listinfo/informix-list >>>> >>> >>> >>> _______________________________________________ >>> Informix-list mailing list >>> Informix-list@iiug.org >>> http://www.iiug.org/mailman/listinfo/informix-list >>> >>> >> >> _______________________________________________ >> Informix-list mailing list >> Informix-list@iiug.org >> http://www.iiug.org/mailman/listinfo/informix-list >> >> > > > -- > Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> > Guardian of DBD::Informix - v2013.0118 - http://dbi.perl.org > "Blessed are we who can laugh at ourselves, for we shall never cease to be > amused."