Standards and
compatibility
SMALLINT data type [Numeric]
Function
Syntax
Usage
Standards and
compatibility
See also
TINYINT data type [Numeric]
Function
Syntax
Usage
♦
Compatible with SQL/92..
SQL/92
♦
Sybase
Compatible with Adaptive Server Enterprise.
Integer value requiring 2 bytes of storage.
[ UNSIGNED ] SMALLINT
The SMALLINT data type is an exact numeric data type; its accuracy is
preserved after arithmetic operations. It requires 2 bytes of storage.
The range for signed SMALLINT values is from -32768 to + 32767.
The range for unsigned SMALLINT values is from 0 to 65535.
♦
Compatible with SQL/92. The UNSIGNED keyword is a
SQL/92
vendor extension.
♦
The signed data type is compatible with Adaptive Server
Sybase
Enterprise. Adaptive Server Enterprise does not support the UNSIGNED
data type.
"INT or INTEGER data type" on page 271
"TINYINT data type" on page 273
"BIGINT data type" on page 268
Unsigned integer, requiring 1 byte of storage.
[ UNSIGNED ] TINYINT
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 from 0 to 255.
In Embedded SQL, TINYINT columns should not be fetched into variables
defined as
or
char
unsigned char
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, the C
variable type should be an integer.
Chapter 7 SQL Data Types
, since the result is an attempt to convert the
273
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers