Listing the Numeric Functions Supported by a Database

This example gets a list of numeric functions that a database supports.
try { DatabaseMetaData dbmd = connection.getMetaData(); // Get the list of numeric functions String[] numericFunctions = dbmd.getNumericFunctions().split(",\\s*"); } catch (SQLException e) { }
Examples in an Oracle database include:
ABS, CEIL, COS, COSH, EXP, FLOOR, LN, LOG, MOD, POWER, ROUND, SIGN, SIN, SINH, SQRT, TAN, TANH, TRUNC, AVG, COUNT, GLB, LUB, MAX, MIN, STDDEV, SUM, VARIANCE
Examples in a MySQL database include:
ABS,ACOS,ASIN,ATAN,ATAN2,BIT_COUNT,CEILING,COS,COT,DEGREES,EXP, FLOOR,LOG,LOG10,MAX,MIN,MOD,PI,POW,POWER,RADIANS,RAND,ROUND,SIN, SQRT,TAN,TRUNCATE

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.