Oracle View calculated column type

Posts   
 
    
Posts: 23
Joined: 19-Aug-2008
# Posted on: 09-Apr-2009 18:34:50   

I have a view where I calculate a value based on other columns' values. The result should be a Number(38,8 ) but is listed in Oracle (I use TOAD) as being a "Number" (i.e. floating point value) and is being seen by LLBLGen as a Number(38,0) which causes a truncation of the data.

Is there a way to tell the code generator to use Number(38,8 ) or an equivalent when generating code so that I don't lose precision?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Apr-2009 04:03:50   
David Elizondo | LLBLGen Support Team
Posts: 23
Joined: 19-Aug-2008
# Posted on: 10-Apr-2009 19:56:39   

daelmo wrote:

I fixed this inside the Oracle view by casting the calculated column to a Number(38,sunglasses .

cast(
    case
        when i.uoi_id in (select uom.uom_id from unit_of_measure uom where uom.UOM_TYPE_CD = 'Weight') then
            i.QUANTITY
        else
            i.QUANTITY * i.WEIGHT_PER_QUANTITY
    end 
as number(38,8) ) as Total_weight,

LLBLGen was then able to get the column type right. So I didn't have to go through the hassle of the TypeConverter.

Thanks.