syscolumns.coltype coding schema
Posted in 1999
Topics: Platform-Specific Issues
I have noticed that the column <anydb>:syscolumns.coltype has a mixed coding schema (discrete values plus partial bit coding). I want to know more about this subject. ( INFORMIX-OnLine Version 7.13.UC1, IBM AIX 4.2 ) Thanks in advance.
Essentially, any coltype > 255 represents a column that does not allow null values. It's counterpart ((NOT NULL value) - 256 = (ALLOWS NULLS value)) will accept nulls. For example: A coltype of 256 represents a CHAR datatype that does not accept nulls. A coltype of 0 (256-256=0) is a CHAR datatype that accepts nulls. Likewise: A coltype of 258 represents an INTEGER datatype that does not accept nulls. A coltype of 2 (258-256=2) represents an INTEGER that accepts null values. I know there is a coltype mapping table somewhere in the documentation, but I cannot recall where exactly. Hope this was what you were looking for. Bob ------- In article <77mtes$9b$1@news.xmission.com>, Michele Iacobellis <m.iacobellis@usa.net> wrote: > > I have noticed that the column <anydb>:syscolumns.coltype has a mixed coding > schema (discrete values plus partial bit coding). > > I want to know more about this subject. > > ( INFORMIX-OnLine Version 7.13.UC1, IBM AIX 4.2 ) > > Thanks in advance. > > -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
rdavis@rmi.net wrote in message <77opkl$bop$1@nnrp1.dejanews.com>... >Essentially, any coltype > 255 represents a column that does not allow null >values. It's counterpart ((NOT NULL value) - 256 = (ALLOWS NULLS value)) will >accept nulls. > >For example: > > A coltype of 256 represents a CHAR datatype that does not accept nulls. > A coltype of 0 (256-256=0) is a CHAR datatype that accepts nulls. > >Likewise: > > A coltype of 258 represents an INTEGER datatype that does not accept nulls. > A coltype of 2 (258-256=2) represents an INTEGER that accepts null values. > >I know there is a coltype mapping table somewhere in the documentation, but I >cannot recall where exactly. > >Hope this was what you were looking for. > 0 = NCHAR 8 = MONEY 1 = SMALLINT 10 = DATETIME 2 = INTEGER 11 = BYTE 3 = FLOAT 12 = TEXT 4 = SMALLFLOAT 13 = NVARCHAR 5 = DECIMAL 14 = INTERVAL 6 = SERIAL 15 = NCHAR 7 = DATE 16 = NVARCHAR You need to also combine this with the collength value to get the precision or size of some types of varaible length / precision types (NVARCHAR, DECIMAL, MONEY....) From Informix Guide to SQL: Reference, the chapter about the sysmaster database! HTH James