SolvedPrivate

Numeric data type conversion from Oracle to SQL Server

Posted on 2014-11-23
9
20 Views
Last Modified: 2016-02-11
I am creating SSIS package. source data is Oracle, destination database is MSSQL 2008 R2


In Oracle, I have data type

The field "conversion_rate" 's data type is number. It results like this 6.16446800641105

In MS SQL,

I create a  corresponding table and a field and define data type is float

In the conversion task mapping

 I put NUMBERIC (DT_NUMBER),  precision =8, Scale=30

When I run the package, it fails

[OLE_SRC_RateTable [1208]] Error: There was an error with output column "CONVERSION_RATE" (1866) on output "OLE DB Source Output" (1218). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".

[OLE_SRC_RateTable [1208]] Error: The "output column "CONVERSION_RATE" (1866)" failed because truncation occurred, and the truncation row disposition on "output column "CONVERSION_RATE" (1866)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "OLE_SRC_GLDailyRates" (1208) returned error code 0xC020902A.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.


Any idea how to fix? What is the fit data type and conversion type to there?
0
Comment
Question by:wasabi3689
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Assisted Solution

by:Koen Van Wielink
Koen Van Wielink earned 168 total points
ID: 40461364
I put NUMBERIC (DT_NUMBER),  precision =8, Scale=30

I assume that the B in "NUMBERIC" is a typo in the question and not in your code?
0
 

Author Comment

by:wasabi3689
ID: 40461432
This is auto drop down to select from SSIS package.
0
 
LVL 12

Accepted Solution

by:
Koen Van Wielink earned 168 total points
ID: 40461455
Have you tried using the Numeric datatype in MSSQL instead of float? Numeric(15,14) would give you a field that should fit the example number you've given (15 is the total number of digits, and 14 indicates how many decimals to use). I believe the use of numeric is equal to the decimal datatype.
0
 
LVL 46

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 166 total points
ID: 40461582
Please verify the data type conversions from MSDN.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 69

Assisted Solution

by:ScottPletcher
ScottPletcher earned 83 total points
ID: 40462736
Oracle number has (up to) 38 digits of precision, whereas float in SQL has only 15 digits of precision.

Try a data type of:
numeric(38, 16)
in SQL Server.
0
 
LVL 21

Assisted Solution

by:Alpesh Patel
Alpesh Patel earned 83 total points
ID: 40464337
Try numeric ( , ) against number( , ) datatype of Oracle.

http://msdn.microsoft.com/en-us/library/ms151817.aspx

Check that Dtatype mapping between Oracle and SQL.
0
 

Author Comment

by:wasabi3689
ID: 40467406
I tried a data type of:
numeric(38, 16)
in SQL Server.

It still throws out the same error "...because truncation occurred..."
0
 
LVL 46

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 166 total points
ID: 40468886
You need SSIS to be able to execute the conversion first. If DT_NUMERIC can't handle it I'm afraid you need to accept the truncation.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now