Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
kiran2509
Explorer
1,672

Expression value data type

example-1: decode(1<>1,2,1.23),   this  evaluates to 1

example-2: decode(1<>1,2.0,1.23) this evaluates to  1.23

example-3: decode(1=1,2.1,1) this evaluates to  2.1

What is happening here?

BODS will cast from left to right, i.e. what ever the datatype of the left most operand is the final datatype of the expression.

in example 1 first operand is 1, entire expression castes/converts to INTEGER

in example 2 first operand is a floting point, entire expression casts/converts to a float/double

in example 3 first operand is a floting point, entire expression casts/converts to a float/double

This issue is applicable where ever a mathematical expression is possible like in query transform, lookup etc.

1 Comment