Re: Do you know the coltype converstion?
Posted in 1993
->From: riskit@x400gate.bnr.ca (Reg Foulkes) ->Subject: Do you know the coltype converstion? ->Date: Sun, 24 Jan 1993 13:23:06 GMT ->Reply-To: riskit@x400gate.bnr.ca (Reg Foulkes) ->Organization: Bell-Northern Research -> ->I need to build a lookup table for coltype in syscolumns. Does anyone have ->a list of the conversions? ->On my system if we do: -> -> Select coltype from syscolumns -> where tabid = "some number" -> ->I will get a list of numbers -> ->0 ->1 ->2 -> . -> . -> . ->256 ->etc -> ->I know O is equivalent to Char and 256 is equivalent to Integer. Can anyone ->help me fill in the blanks. ->thanks... -> ->riskit@bnr.ca ->phone (613) 763-4131 ->Ottawa, Ontario Canada. Reg, Your requested table is attached. You made one error in your e-mail: 256 is NOT 'integer', it is 'char(n) not null'. In general, if coltype = x is type 'y', then coltype = x+256 is type 'y not null'. coltype data type 0 CHAR(n) collength gives bytes (=n) 1 SMALLINT 2 INTEGER 3 FLOAT 4 SMALLFLOAT 5 DECIMAL(n,m) collength gives digits, encoded 6 SERIAL 7 DATE 8 MONEY(n,m) collength gives digits, encoded 9 INTERVAL collength gives units 10 DATETIME collength gives units 256 CHAR(n) NOT NULL 257 SMALLINT NOT NULL 258 INTEGER NOT NULL 259 FLOAT NOT NULL 260 SMALLFLOAT NOT NULL 261 DECIMAL(n,m) NOT NULL collength gives digits 262 SERIAL NOT NULL 263 DATE NOT NULL 264 MONEY(n,m) NOT NULL collength gives digits 265 INTERVAL NOT NULL collength gives units 266 DATETIME NOT NULL collength gives units Translating the collength for DECIMAL, MONEY, INTERVAL, and DATETIME is possible, but a pain. If you need the info, let me know. Regards, Alan +------------------------------+---------------------------------------+ | R. Alan Popiel | Internet: alan@den.mmc.com | | Martin Marietta, LSC | ( Please note: My opinions do not ) | | P.O. Box 179, M/S 5422 | ( represent official Martin policy. ) | | Denver, Colorado 80201-0179 | Voice: 303-977-9998 | +------------------------------+---------------------------------------+