Information

This site will undergo a brief period of maintenance on Friday, 18 December at 12:30 AM Central/12:00 PM IST. During a 30 minute window, site availability may be intermittent.

Default language.

Information
Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Check for Db2 13.1.

Decimal comparisons


When comparing two decimal numbers that have different precision and scale, 

BMC AMI Utilities

 SQL converts the two numbers to a uniform precision and scale, which are derived from the following formulas:

  • P = MIN(31,MAX(S1,S2)+MAX(P1-S1,P2-S2))
  • S = MAX(S1,S2)
Information
Example

Assume that number 1 is DEC(31,31) and has a value of .31; number 2 is DEC(31,0) and has a value of 31. The uniform precision is:

 P = MIN(31,MAX(31,0)+MAX(0,31))
= MIN(31,62)
= 31

The uniform scale is:

S = MAX(31,0)
= 31

Therefore, number 2 needs to be converted to DEC(31,31). However, this conversion will result in an overflow.

 

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

BMC AMI Check for Db2 12.1