The SIGN function returns an indicator of the sign of expression. The returned value is:
The result has the same data type and length attribute as the argument, except that precision is increased by one if the argument is DECIMAL or NUMERIC and the scale of the argument is equal to its precision. For example, an argument with a data type of DECIMAL(5,5) will result in DECIMAL(6,5). If the precision is already the maximum precision (mp), the scale will be decreased by one. For example, DECIMAL(63,63) will result in DECIMAL(63,62).
If the argument can be null, the result can be null; if the argument is null, the result is the null value.
SELECT SIGN(:PROFIT) FROM EMPLOYEEReturns the value 1.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.