Quantcast
Channel: Data Services and Data Quality
Viewing all articles
Browse latest Browse all 236

BODS - Expression value data type, typecast

$
0
0

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.


Viewing all articles
Browse latest Browse all 236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>