background image
<< SIGN function | SUBSTR function >>

SMALLINT function

<< SIGN function | SUBSTR function >>
Derby Reference Manual
139
The specified number is the angle, in radians, that you want the hyperbolic sine for. The
specified number must be a
DOUBLE PRECISION
number.
· If the specified number is NULL, the result of this function is NULL.
· If the specified number is zero (0), the result of this function is zero.
The data type of the returned value is a DOUBLE PRECISION number.
Syntax
SIN ( number )
SMALLINT function
The SMALLINT function returns a small integer representation of a number or character
string in the form of a small integer constant.
Syntax
SMALLINT ( NumericExpression | CharacterExpression )
NumericExpression
An expression that returns a value of any built-in numeric data type. If the argument is
a NumericExpression, the result is the same number that would occur if the argument
were assigned to a small integer column or variable. If the whole part of the argument
is not within the range of small integers, an error occurs. The decimal part of the
argument is truncated if present.
CharacterExpression
An expression that returns a character string value of length not greater than
the maximum length of a character constant. Leading and trailing blanks are
eliminated and the resulting string must conform to the rules for forming an SQL
integer constant. However, the value of the constant must be in the range of
small integers. The character string cannot be a long string. If the argument is
a CharacterExpression, the result is the same number that would occur if the
corresponding integer constant were assigned to a small integer column or variable.
The result of the function is a small integer. If the argument can be null, the result can be
null. If the argument is null, the result is the null value.
Examples
To determine the small integer representation of the number 32767.99, use this clause:
VALUES SMALLINT (32767.99)
The result is 32767.
To determine the small integer representation of the number 1, use this clause:
VALUES SMALLINT (1)
The result is 1.
SQRT function
Returns the square root of a floating point number; only the built-in types
REAL
,
FLOAT
,
and
DOUBLE PRECISION
are supported. The return type for SQRT is the type of the
parameter.
Note: To execute SQRT on other data types, you must cast them to floating point types.
Syntax
SQRT(FloatingPointExpression)