Supported Data Types

From InterBase

Go Up to Working with Data


To query or write to a table, it is necessary to know the structure of the table, what columns it contains, and what data types are defined for those columns. InterBase supports ten fundamental data types, described in the following table:

Data types supported by InterBase
Name Size Range/Precision Description

BLOB

Variable

  • None
  • Blob segment size is limited to 64K
  • Dynamically sizable data type for storing data such as graphics, text, and digitized voice.
  • Basic structural unit is the segment.
  • Blob sub-type describes Blob contents.

BOOLEAN

16 bits

  • TRUE
  • FALSE
  • UNKNOWN
  • Represents truth values TRUE, FALSE, and UNKNOWN.
  • Requires ODS 11 or higher, any dialect.

CHAR(n)

<n> characters

  • 1 to 32,767 bytes
  • Character set character size determines the maximum number of characters that can fit in 32K
  • Fixed length CHAR or text string type.
  • Alternate keyword: CHARACTER

DATE

32 bits

1 Jan 100 a.d. to 29 Feb 32768 a.d.

ISC_DATE

DECIMAL ­(<precision>, <­scale>)

Variable
(16, 32, or
64 bits)

  • <precision> = 0 to 18; specifies at least <precision> digits of precision to store.
  • <scale> = 0 to {value}; specifies number of decimal places for storage.
  • <Scale must be less than or eqaul to precision>.
  • Number with a decimal point <scale> digits from the right for example: DECIMAL(10, 3) holds numbers accurately in the following ­format: ppppppp.sss

DOUBLE ­PRECISION

64 bits1

2.225 x 10–308 to 1.797 x 10308

IEEE double precision: 15 digits

FLOAT

32 bits

1.175 x 10–38 to 3.402 x 1038

IEEE single precision: 7 digits

INTEGER

32 bits

–2,147,483,648 to 2,147,483,647

Signed long (longword)

NUMERIC ­(<precision>, <­scale>)

Variable

(16, 32, or
64 bits)

  • <precision> = 0 to 18; specifies exactly <precision> digits of precision to store.
  • <scale> = 0 to {value}; specifies number of decimal places for storage.
  • <Scale must be less than or eqaul to precision>
  • Number with a decimal point <scale> digits from the right for example: NUMERIC(10,3) holds numbers accurately in the following ­format: ppppppp.sss

SMALLINT

16 bits

–32,768 to 32,767

Signed short (word)

TIME

32 bits

00:00:00.0000 to 23:59:59.9999

ISC_TIME

TIMESTAMP

64 bits

1 Jan 100 a.d. to 29 Feb 32768 a.d.

ISC_TIMESTAMP contains both date and time information.

VARCHAR (<n>)

<n> characters

  • 1 to 32,765 bytes
  • Character set character size determines the maximum number of characters that can fit in 32K.
  • Variable length CHAR or text string type
  • Alternate keywords: CHAR VARYING, CHARACTER VARYING
  1. Actual size of DOUBLE is platform-dependent. Most platforms support the 64-bit size.

The BLOB data type can store large data objects of indeterminate and variable size, such as bitmapped graphics images, vector drawings, sound files, chapter or book-length documents, or any other kind of multimedia information. Because a Blob can hold different kinds of information, it requires special processing for reading and writing. For more information about Blob handling, see Working with Blob Data.

The DATE, TIME, and TIMESTAMP data types may require conversion to and from InterBase when entered or manipulated in a host-language program. For more information about retrieving and writing dates, see Working with Dates and Times.

InterBase also supports arrays of most data types. An array is a matrix of individual items, all of any single InterBase data type, except Blob, that can be handled either as a single entity, or manipulated item by item. To learn more about the flexible data access provided by arrays, see Using Arrays.

For a complete discussion of InterBase data types, see the Data Definition Guide.

Note:
InterBase looks for Booleans of the form “literal <relop> literal” that evaluate to FALSE and returns a false Boolean inversion node to short-circuit data retrieval.

Advance To: