Here is my corrected query. I didn't clean it up properly the first post but
the effect is the same: overflow error from the .Net Oracle client.
Dale
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable pt
Hello Dale,
According to your description, you meet an issue that following select
command will throw an "Oracle Client Error OCI-22053 Overflow Error"
exception by .Net Oracle client. If I misunderstoo, please correct me.
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable pt
It seems the issue is related to "pt.val1/pt.val2". As far as I know,
System.Data.OracleClient namespace does only support 38 digits.
I suggest you use ORACLE SQL TRUNC(number, decimal_places) function to work
around it.
http://www.techonthenet.com/oracle/functions/trunc_nbr.php
[Oracle/PLSQL: Trunc Function (with numbers)]
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN trunc(pt.val1/pt.val2,6)
ELSE 1
END
) AS rate
FROM myTable pt
Hope this helps. Please try the above method and let me know if this works
on your side. It's my pleasure to assist you.
Have a great day.
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Dale - 30 Aug 2007 15:18 GMT
Thanks Wen,
That did solve the problem. I also found another article suggesting
ROUND(val1/val2, 2) which worked as well.

Signature
Dale Preston
MCAD C#
MCSE, MCDBA
> Hello Dale,
>
[quoted text clipped - 36 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 31 Aug 2007 05:28 GMT
Welcome, Dave.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 31 Aug 2007 05:30 GMT
Welcome, Dale.
If you have any further issue, please feel free to update here again. I'm
glad to assist you.
Have a great day,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.