Page 1 of 1

Convert Decimal to Bigint

Posted: Wed Jan 02, 2013 8:41 pm
by mandyli
Hi


I would to like to convert from Decimal to Bigint.

Is this anything I have to do from Transformer stage?


Thanks
Man

Posted: Wed Jan 02, 2013 11:40 pm
by jwiles
Only if you need to save the decimal portion of the value.

Regards,

Posted: Wed Jan 02, 2013 11:51 pm
by ray.wurlod
For example you may want to specify how the number is to be rounded or truncated.

Of course, if your decimal number has a scale of 0, that point is moot.

Posted: Thu Jan 03, 2013 10:49 am
by mandyli
Thanks Ray & Wiles,


I have imported metadata from Orchestrate, there defined as Decimal 38 ,10.

But inside lookup they changed Decimal 38,10 to Bigint. Actually there is no decimal value all are whole Integer values. I am not sure why it is convert into Decimal 38,10 from NUMBER datatype after import into Datastage.

desc stage.v_m_xref
Name Null Type
--------------------------------------------------------------------------------------MID NOT NULL NUMBER
VMKE_ID NOT NULL NUMBER



Thanks
Man

Posted: Thu Jan 03, 2013 11:18 am
by jwiles
Oracle NUMBER fields (with no precision/scale defined) are imported into DataStage as Decimal(38,10) by default. The import process has no visibility to the actual data values present. You are certainly free to modify the scale value in the Table Definition you imported if you desire.

Regards,

Posted: Thu Jan 03, 2013 1:55 pm
by chulett
I was wondering if we were still on this topic. There's no need to effect any 'conversion' in this scenario that I can see.

Posted: Wed Jan 09, 2013 2:35 pm
by mandyli
Hi


I am going to close this. I hope IBM tightened up metadata checking between DataStage and the Database considerably since 8.1. So I have re-import the metadata for this table using Orchestrate into 8.7(Since we are using ORACLE EE stage), delete the metadata from the stage and reload it.

And then I can able to convert Decimal (38,10) to BIgint from Transformer stage.


Thanks for your help.

Thanks
Man