Contents Index SMALLINT data type [Numeric] Money data types

ASA SQL Reference
  SQL Data Types
    Numeric data types

TINYINT data type [Numeric]


Function 

Unsigned integer requiring 1 byte of storage.

Syntax 

UNSIGNED ] TINYINT

Usage 

The TINYINT data type is an exact numeric data type; its accuracy is preserved after arithmetic operations.

You can explicitly specify TINYINT as UNSIGNED, but the UNSIGNED modifier has no effect as the type is always unsigned.

The range for TINYINT values is 0 to 28  - 1, or 0 to 255.

In Embedded SQL, TINYINT columns should not be fetched into variables defined as char or unsigned char, since the result is an attempt to convert the value of the column to a string and then assign the first byte to the variable in the program. Instead, TINYINT columns should be fetched into 2-byte or 4-byte integer columns. Also, to send a TINYINT value to a database from an application written in C, the type of the C variable should be integer.

Standards and compatibility 
See also 

BIGINT data type [Numeric]

TINYINT data type [Numeric]

SMALLINT data type [Numeric]


Contents Index SMALLINT data type [Numeric] Money data types