Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

exp function and numberic overflow ORA-01426

554928Dec 8 2008 — edited Dec 8 2008
I've got a problem that has been driving me slightly mad over the past few days. I have been trying to code some actuarial functions that I don't really understand for a data warehouse load on Oracle 9.2.0.6

I am trying to use exp() and power() functions in an insert statement. There is some slightly dodgy data in the source table that is causing a numeric overflow to occur for some rows so I have written a function which calculates the values and returns the result. If an exception occurs, this will be caught and the result set to 0.

The problem I am finding is that within the function, the power() function will successully raise a value_error exception when a problem occurs. However, the exp() function will not. When calling exp() with a large number as the parameter, it will simply return 1e126, which will subsequently cause a numeric overflow when calculating the value for another column.

However, the number overflow will be raised if I use select exp(...) into ... from dual

Is this just a weird inconsistency between the SQL and PL/SQL engine. I thought these problems had been resolved with Oracle 9 but I guess not.

I think I can probably work-around the problem for here, just looking for confirmation that my thoughts are correct.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2009
Added on Dec 8 2008
4 comments
1,303 views