Page 1 of 1

Data type from varchar2 to decimal

Posted: Wed May 31, 2006 9:44 pm
by vivek
Hi Gurus,
I have a column in my source(oracle) which is of Varchar2 data type.It is a column which has two constant vaues TRUE and FALSE.
But in the target(Oracle), same column's datatype is decimal.When i tried loadingi am getting Nulls.
Please give your valuable suggestions to overcome this issue.
(Actually i tried changing the data type of the target column, but still i am not getting the out put.)

Posted: Wed May 31, 2006 10:36 pm
by kumar_s
There should be a field level mapping give to you. Or look into the given buisness rules. There might be some code change involved. Somting like 1--> True; 0 --> False. Use transformer to acheive this.
And dont try acheive somting new by fiting charecters into decimal field.

Posted: Thu Jun 01, 2006 5:41 am
by vivek
Kumar,
You are right. In the target The True or False becomes 1 AND 0. Can you explain me how to achieve this in the tarnsformer?

Posted: Thu Jun 01, 2006 6:59 am
by chulett
It's just a simple if-then-else statement in your derivation. This is not something you've had to do before? :?

The only thing that might 'complicate' the process a little is if there may be values other than TRUE or FALSE in the field, or if it might come in various cases or if it could possibly be null.

If that's the case, we'd need to know the transformation rules for those situations but it still should be very straight-forward. Why not take a shot a doing it yourself and see if you can work it out rather than waiting for someone to spoon-feed you an answer?

Post back with a more specific question if you run into a problem.

Posted: Thu Jun 01, 2006 7:09 am
by DSguru2B
It would be:
If Columnname = True then 1 else if Columname = False then 0 else @NULL.

Posted: Thu Jun 01, 2006 7:12 am
by chulett
[sigh]

Not quite right. How 'bout we let Vivek work it out from there as a learning exercise rather than pick up the spoon again?

Posted: Thu Jun 01, 2006 7:46 am
by DSguru2B
Craig,
What I meant was just a logical head start for the poster. Dint mean to solve the problem :D


chulett wrote: How 'bout we let Vivek work it out from there as a learning exercise rather than pick up the spoon again?
Very True

Posted: Thu Jun 01, 2006 8:08 am
by dls
vivek, a simpler approach may be to DECODE your source value. See Oracle's DECODE function.