BIML assigns wrong NUMBER metadata to columns from Oracle
I have successfully created a BIML script on BIDS 2008 using BIDS Helper 1.6.6.0, which automates the generation of SSIS packages to import data from an Oracle database (11g Enterprise Edition Release 11.2.0.3.0 - 64bit) in SQL Server 2008 R2. I am having a problem during package execution that causes the package to fail when validating the data stream with:
Warning. The external columns for the Source component (1) are out of sync with the columns in the data source. The external column "LIMIT_AMOUNT" needs to be updated. The external column "LIMIT_BASE_AMOUNT" needs to be updated. The external column "GROSS_BASE_AMOUNT" needs to be updated.
Error: The OLE DB provider used by the OLE DB adapter cannot convert between types "DT_BYTES" and "DT_NUMERIC" for "LIMIT_AMOUNT".
Mistake. The OLE DB provider used by the OLE DB adapter cannot convert between types "DT_BYTES" and "DT_NUMERIC" for "LIMIT_BASE_AMOUNT".
Mistake. The OLE DB provider used by the OLE DB adapter cannot convert between types "DT_BYTES" and "DT_NUMERIC" for "GROSS_BASE_AMOUNT".
Error: Errors occurred while validating the task.
Upon validation, it turns out that the metadata for columns NUMBER
without scaling and precision in Oracle appears in DT_BYTES
the generated SSIS. The description of the above object (view) in Oracle is as follows:
Name Null Type
--------------------- ---- ------------
ID NUMBER(12)
CURRENCY VARCHAR2(3)
LIMIT_AMOUNT NUMBER
LIMIT_BASE_AMOUNT NUMBER
GROSS_BASE_AMOUNT NUMBER
STATUS VARCHAR2(15)
The check all_tab_columns
shows three columns NUMBER
as having DATA_LENGTH
of 22 and NULL DATA_PRECISION
and DATA_SCALE
.
COLUMN_ID COLUMN_NAME DATA_TYPE DATA_LENGTH DATA_PRECISION DATA_SCALE
---------- ---------------------- ------------- ----------- -------------- ----------
1 ID NUMBER 22 12 0
2 CURRENCY VARCHAR2 3
3 LIMIT_AMOUNT NUMBER 22
4 LIMIT_BASE_AMOUNT NUMBER 22
5 GROSS_BASE_AMOUNT NUMBER 22
6 STATUS VARCHAR2 15
Oracle documentation states that this is the equivalentfloat
Specify a floating point number using the following form:
NUMBER
The absence of precision and scale pointers indicates the maximum range and precision for the Oracle number.
The workaround so far has been to implement a custom SELECT that gives these fields the desired type, but not very elegant or maintainable. I would like to understand why BIML seems to display the datatype mapping incorrectly, whereas SSIS can determine that the metadata is wrong when the package is first opened after it has been created. I get a popup in BIDS stating that
The metadata of the following output columns does not match the metadata of the external columns to which the output columns are associated:
Exit "Exit": "LIMIT_AMOUNT", "LIMIT_BASE_AMOUNT", "GROSS_EXP_BASE_AMOUNT"
Do you want to replace the metadata of the output columns with the metadata of the external columns?
EDIT: Adding relevant Biml data regarding connections and data flow
<# string OraConnectionStr = @"Provider=OraOLEDB.Oracle;Data Source=(In-line TNS);User Id=redacted;Password=redacted;Persist Security Info=True;"; string StagingConnectionStr = "Data Source=SVR;Initial Catalog=DB;Integrated Security=SSPI;Provider=SQLNCLI10;"; #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Connections> <Connection Name="<#=StagingConnectionName#>" ConnectionString="<#=StagingConnectionStr#>" /> <Connection Name="<#=OraConnectionName#>" ConnectionString="<#=OraConnectionStr#>" /> </Connections> <Packages> <!-- Assume object stagingTables is populated and methods have been defined --> <# foreach (DataRow row in stagingTables.Rows) { #> <Package Name="<#= GetChildPackageName(row) #>" ConstraintMode="Linear" AutoCreateConfigurationsType="None"> <Dataflow Name="<#=GetStagingTableDescriptiveName(row)#>" > <Tasks> <Transformations> <OleDbSource Name="Source - <#=GetStagingTableDescriptiveName(row)#>" ConnectionName="<#=OraConnectionName#>" AlwaysUseDefaultCodePage="true" DefaultCodePage="1252"> <DirectInput>SELECT * FROM <#GetOracleObjectName(row)#></DirectInput> </OleDbSource> <OleDbDestination Name="Destination - <#=GetStagingTableDescriptiveName(row)#>" ConnectionName="<#=DataLoadConnectionName#>"> <ExternalTableOutput Table="<#= GetStagingTableObjectName(row) #>" /> </OleDbDestination> </Transformations> </Dataflow> </Tasks> </Package> <# } #> </Packages </Biml>
Thanks in advance.
source to share
No one has answered this question yet
Check out similar questions: