Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Numeric precision conversion : truncation instead of rounding

Re: Numeric precision conversion : truncation instead of rounding

From: Billy <vslabs_at_onwe.co.za>
Date: 25 Oct 2005 22:22:51 -0700
Message-ID: <1130304171.668706.278360@g43g2000cwa.googlegroups.com>


morsi wrote:

> I'm working in a project of converting an application from Syabse to
> Oracle (1000 man-day).
> In Sybase, the result of convert(numeric(4,2),1.2378) is 1.23
> In Oracle, the result of cast(1.2378 as number(4,2)) is 1.24
> I look the same thing in implicit conversion : insert number(6,4) value
> in a table column of the type numeric(4,2)
> How to modify the oracle behaviour (any server option ? )to do
> truncation instead of rounding ? Of course I can use truncate function
> but it will complicate all the obvious conversions.

The issue is precision. Oracle is right. Sybase is wrong. (in this group at least - if you want Oracle to be wrong try comp.databases.sybase ;-)

Besides, attempting to insert a number(6,4) into a number(4,2) column.. well that sounds like.. looking for trouble... head up arse.. stupid.. a lead pipable offense.. to mention just a few of the terms that jumps to mind.

And if that is how Sybase was treated over there.. a 1000 mandays conversion to Oracle ain't gonna solve -any- of the problems over there.

--
Billy
Received on Wed Oct 26 2005 - 00:22:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US