July 31, 2008 at 9:12 am
SQL 2005 SP2, Oracle 8i
I'm extracting currency data from Oracle, but when I look at the data in SQL Server the values have been converted to integers so I've lost all the pence (or cents if I was in the US). The field I'm importing into is decimal(10,2). I've worked around it by multiplying by 100 in my Oracle extract query and using a derived column transform to divide again, but it's a pretty ugly kludge. I'm using Microsoft OLEDB Provider for Oracle (MSDORA.1). I've doublechecked my source data and it definitely contains data after the decimal point. Can anyone point me in the right direction to fix this?
Thanks
Scott
--
Scott
July 31, 2008 at 9:29 am
July 31, 2008 at 9:54 am
The metadata says DT_NUMERIC (38,0) for the column, even when I do an explicit cast to decimal(10,2) in the source query. I can't see a way to edit the metadata.
Scott
--
Scott
July 31, 2008 at 9:58 am
July 31, 2008 at 10:03 am
I've just tried that with the same outcome as before. My source query contains CAST(AMOUNT_DUE_ORIGINAL AS DECIMAL(10,2)) and this is showing as DT_NUMERIC (38,0) in the metadata.
July 31, 2008 at 10:11 am
July 31, 2008 at 10:18 am
Same as before. Just to confirm what I'm doing:
in the data flow task, delete the existing OLE DB source
create new source pointing at the connection manager for Oracle
set data access mode to SQL command and paste in my query
set ValidateExternalMetadata to False
then connect OLE DB source to OLE DB destination
doubleclick on data flow path and click Metadata on the left
still says DT_NUMERIC (38,0)
July 31, 2008 at 12:38 pm
The 10g oracle client is not 100% OLEDB compliant. I am sure it is not the only client version with compliance issues. It has caused the same issue you are describing and also, at times will completely reject fields regardless of casting them indicating that the scale and precision is outside the acceptable range.
Both the MS OLEDB driver and the Oracle OLEDB driver gave me the same results.
To deal with it, I usually convert decimal numbers to strings in my query and then convert them back to decimals in the SSIS package.
August 1, 2008 at 2:23 am
Looks like I'll carry on kludging then. Thanks for the help.
Scott
--
Scott
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply