Supported numeric functions

The driver supports the following data types and numeric functions.

Supported data types

  • numeric_exp – The numeric expression can be a column name, the result of another scalar function, or a numeric literal. The underlying data type can be SQL_NUMERIC, SQL_DECIMAL, SQL_TINYINT, SQL_SMALLINT, SQL_INTEGER, SQL_BIGINT, SQL_FLOAT, SQL_REAL, or SQL_DOUBLE.
  • float_exp – The floating-point expression can be a column name, the result of another scalar function, or a numeric literal. The underlying data type can be SQL_FLOAT.
  • integer_exp – The integer expression can be a column name, the result of another scalar function, or a numeric literal. The underlying data type can be SQL_TINYINT, SQL_SMALLINT, SQL_INTEGER, or SQL_BIGINT.

Numeric functions

Function ODBC Version Technical Description
ABS( numeric_exp ) 1.0 Returns the absolute value of numeric_exp.
ACOS( float_exp ) 1.0 Returns the arccosine of float_exp in radians.
ASIN( float_exp ) 1.0 Returns the arcsine of float_exp in radians.
ATAN( float_exp ) 1.0 Returns the arctangent of float_exp in radians.
ATAN2( float_exp1, float_exp2 ) 2.0 Returns the arctangent of float_exp1 and float_exp2 in radians.
COS( float_exp ) 1.0 Returns the cosine of float_exp in radians.
COT( float_exp ) 1.0 Returns the cotangent of an angle expressed in radians.
DEGREES( numeric_exp ) 2.0 Converts radians in numeric_exp to degrees.
EXP( float_exp ) 1.0 Calculates the exponential value of a given floating-point expression.
FLOOR( numeric_exp ) 1.0 Returns the largest integer less than or equal to the input numeric value.
LOG( float_exp ) 1.0 Returns the natural logarithm of a floating-point expression.
LOG10( float_exp ) 2.0 Returns the base 10 logarithm of a floating-point expression.
MOD( integer_exp1, integer_exp2 ) 1.0 Calculates the remainder when integer_exp1 is divided by integer_exp2.
PI( ) 1.0 Returns the mathematical constant π (pi) as a floating-point value.
POWER( numeric_exp, integer_exp ) 2.0 Raises numeric_exp to the power of integer_exp and returns the result.
RADIANS( numeric_exp ) 2.0 Converts numeric_exp degrees to radians.
RAND([integer_exp]) 1.0 Returns a random floating-point value between 0 and 1.
If integer_exp is provided, it is used as the seed for reproducible results.
ROUND( numeric_exp, integer_exp ) 2.0 Rounds numeric_exp to the specified number of decimal places.
A positive integer_exp rounds to places right of the decimal point, while a negative integer_exp rounds to places left.
SIGN( numeric_exp ) 1.0 Returns the sign of a numeric value: -1 if numeric_exp is negative, 0 if zero, and 1 if positive.
SIN( float_exp ) 1.0 Returns the sine of float_exp in radians.
SQRT( float_exp ) 1.0 Calculates the square root of a floating-point expression.
TAN( float_exp ) 1.0 Computes the tangent of float_exp in radians.
TRUNCATE( numeric_exp, integer_exp ) 2.0 Returns numeric_exp truncated to integer_exp decimal places.
A positive integer_exp removes digits to the right of the decimal point, while a negative integer_exp removes digits to the left.

For more information, see Numeric functions.