Download Informix Guide to SQL: Reference
Transcript
INTEGER INTEGER The INTEGER data type stores whole numbers that range from −2,147,483,647 to 2,147,483,647. The maximum negative number, −2,147,483,648, is a reserved value and cannot be used. The INTEGER data type is stored as a signed binary integer and is typically used to store counts, quantities, and so on. Arithmetic operations and sort comparisons are performed more efficiently on integer data than on float or decimal data. However, INTEGER columns can store only a limited range of values. If the data value exceeds the numeric range, the database server does not store the value. INTEGER data types require 4 bytes per value. INTERVAL The INTERVAL data type stores a value that represents a span of time. INTERVAL types are divided into two classes: year-month intervals and day-time intervals. A year-month interval can represent a span of years and months, and a day-time interval can represent a span of days, hours, minutes, seconds, and fractions of a second. An INTERVAL value is always composed of one value, or a contiguous sequence of values, that represents a component of time. The following example defines an INTERVAL data type: INTERVAL largest_qualifier(n) TO smallest_qualifier(n) In this example, the largest_qualifier and smallest_qualifier fields are taken from one of the two INTERVAL classes, as Figure 2-6 shows, and n optionally specifies the precision of the largest field (and smallest field if it is a FRACTION). 2-16 Informix Guide to SQL: Reference