Monday, September 13, 2010

Error code :2616 : Numeric overflow occured during computation

Below is the scenario when this error occurs

2616 : Numeric overflow occured during computation

sel count(*) from DPRODUIT;
Numeric overflow occured during computation


Reason:  result value is more then integer range.   The output was 2,333,452,124  --> which is more than integer limit. Hence it resulted in numeric overflow.

How to fix the issue?
Solution:
Using cast to convert result from integer to decimal will work  .
COunt(*)  always provides result in integer format. Hence using  cast we can get values larger than integer limit of * characters

sel  cast (count(*) as decimal(18,0) ) from DPRODUIT;
result : 2,333,452,124

1 comment:

  1. thank you for this post. It helped me

    ReplyDelete