Use this function to convert a value to a SMALLINT.

Syntax

SMALLINT ( convExpression )

Arguments

  • convExpression: A value to convert to SMALLINT which can evaluate to any of the numeric types or a character string that is a numeric constant.

Returns

convExpression is… Returns
Numeric type returns the integer portion of the value and truncates any decimal positions.
character string length no longer than the allowed SMALLINT.
NULL NULL

Examples

VALUES SMALLINT('12345');
-- Returns
12345