Download Informix Guide to SQL: Tutorial, Version 6.0

Transcript
Defining the Domains
• It is not available with all Informix database servers.
You can display TEXT values in reports generated with INFORMIX-4GL
programs or the ACE report writer. You can display TEXT values on a screen
and edit them using screen forms generated with INFORMIX-4GL programs
or with the PERFORM screen-form processor.
Binary Objects: BYTE
The BYTE data type is designed to hold any data a program can generate:
graphic images, program object files, and documents saved by any word processor or spreadsheet. The database server permits any kind of data of any
length in a BYTE column.
As with TEXT, BYTE data items are stored in whole disk pages in separate disk
areas from normal row data.
The advantage of the BYTE data type, as opposed to TEXT or CHAR(n), is that
it accepts any data. Its disadvantages are the same as those of the TEXT data
type.
Changing the Data Type
You can use the ALTER TABLE statement to change the data type assigned to
a column after the table is built. Although this is sometimes necessary, you
should avoid doing it for the following reasons:
• To change a data type, the database server must copy and rebuild the
table. For large tables, that can take a lot of time and disk space.
• Some data-type changes can cause a loss of information. For example,
when you change a column from a longer to a shorter character type, long
values are truncated; when you change to a less-precise numeric type,
low-order digits are truncated.
• Existing programs, forms, reports, and stored queries also might have to
be changed.
Default Values
A default value is the value inserted into a column when an explicit value is
not specified in an INSERT statement. A default value can be a literal character string defined by you or one of the following SQL null, constant
expressions:
•
•
USER
CURRENT
Implementing Your Data Model 9-19