Numeric comparisons


When you compare two numerical expressions of different types, the BMC AMI Utilities SQL language converts one type to the type of the other and then compares them.

The conversion rules are the same as outlined in SQL reference with the exceptions of FLOAT and DECIMAL comparisons. IBM Db2 converts the decimal to FLOAT and then carries out the comparison in FLOAT format. This technique produces correct results if the decimal precision is greater than 18.

Example

If the following two numbers are compared under Db2, the result is EQUAL, which is incorrect:

DEC310=1234567890123456789012345678901
FLOAT=.12345678901234568 E +31

To correct the result, the BMC AMI Utilities SQL language converts the float to a decimal number, and then compares them in decimal format. This technique might produce undesirable results when a floating-point fraction cannot be represented exactly in decimal format. In this case, We recommend using either the FLOAT() or the DECIMAL() function to control this process.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*