Re: Size of columns
Posted in 1995
Claude Chesselet (chessec@aztec.co.za) wrote: : Can anyone help? : I need to determine the length of columns from the syscolumns table where the : column type is a decimal and when attempting to determine the length I do not : know the precision or the scale of the column. : Does anyone know how to do this? From a 4gl function for this purpose written long ago: FUNCTION dec_length() # calculate length & precision for DECIMAL data types DEFINE len, prec SMALLINT # Length & Precision LET len = r_syscol.collength / 256 LET prec = r_syscol.collength mod 256 IF prec > len THEN # floating precision LET prec = NULL END IF RETURN len, prec END FUNCTION # dec_length() -- ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.