Re: calculating collength in syscolumns
Posted in 1998
In article <01bd3183$302eeb60$35207da7@rfahey.gemini.ca>,
"R Fahey" <r.fahey@usa.net> wrote:
>
> I am trying to calculate the actual column length for a column type of
> 10/14(DATETIME/INTERVAL) from within a
> stored procedure.In reading TFM it provides a formula of,
> (length*256)+(largest_qualifier_value*16)+smallest_qualifier_value).
It seems that
select tabid, colname, coltype, TRUNC(collength/256) from syscolumns;
must return length. Isn't it?
> These 'qualifier_values' are given in TFM but I can't seem to find a way of
> determing them from within my stored proc.
> For example, a type 10(DATETIME), can be any 1 of 28 possible precisions.
> What I need is to be able to determine
> this precision, so that I can then detrermine the actual number of bytes
> used for that column.
>
> Thanks in advance
>
> Richard Fahey
Vardan
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet