Re: TEXT or BYTE
Posted in 1996
Marko Lorentz [RHRK] (lorentz@rhrk.uni-kl.de) wrote: : After reading the Informix Reference Guide to SQL (V7.1) : i'am a bit confused about the capabilities of the : TEXT Datatype. : * Informix doesn't recommend to enter any "non-printable" : characters excapt tabs, newlines, newpages into TEXT : columns; only ASCII characters are supported. : So what is the use of TEXT in an NLS environment, : where many non-ASCII characters occur? "Non-printable" characters does not refer to NLS characters like accented letters or the extended Ascii character set; it means characters that cannot be printed (0x07, for example). As a general rule, any file you can "vi" can be a TEXT datatype; thus you can store a text document written in a non-English language in a TEXT. : * Why does Informix support TEXT and BYTE if there : is no NLS-Support for TEXT? NLS has no meaning for TEXT, because basically NLS is about collating sequence, and collating is not supported on BLOBs. If you care about collation, you must use CHAR or NCHAR. CHAR does ordering in ASCII order; NCHAR does ordering in NLS order. TEXT does no ordering at all. : I don't see any significant difference in those 2 : datatypes. There is not that much difference between TEXT and BYTE. - If you have a datatype defined as TEXT, and you put a 10-character field on your 4GL/I-SQL form for this field and try to display to it, the first 10 characters of your TEXT will be displayed in the field. A BYTE column will simply say "<BYTE value>". Similarly, if, from DB-Access or I-SQL, you issue a "SELECT * FROM tabname", a TEXT column will be displayed in its entirety; a BYTE column will say "<BYTE value>". - Using PERFORM, you can edit or view a TEXT column using vi; that is, this functionality is built-in. - If you UNLOAD a TEXT column, it will simply be unloaded into your unload file (with newlines appropriately escaped and such). If you UNLOAD a BYTE column, it will be converted into ASCII by translating each byte into the ASCII representation of the two hex nibbles. For example, if you put a text file containing "hello world" into a BYTE, the unload file would contain: 68656c6c6f20776f726c64 (h=0x68, e=0x65, etc). Can't think of anything else off the top of my head. June ---- June Tong Informix Software ---- ---- Senior Consultant (415) 926-6140 ---- ---- International Support junet@informix.com ---- ---- Location-du-jour: Menlo Park ---- * * Standard disclaimers apply * - Please do not send me requests/questions by mail. When I have the knowledge - and time permits, I try to answer questions on comp.databases.informix, but - travel schedule, time, and volume make responding to personal requests - difficult and often slow. Please call your local Informix Technical Support - organization for assistance with technical issues.