Question

I'm in the process of creating a suite of packages to import data from our ERP system running on Informix IDS 11.7 into SQL server (2012).

Using SSIS to import this data I've come across an issue. I can access the data in 2 ways, using an ODBC connection and an ADO.NET data source, or using the OLEDB connection and provider.

Using ODBC is about 3 times slower (conservatively!), so naturally I'm keen to move away from that.

However the problem is, when I use OLEDB the data source is reporting the wrong data types.

NVARCHAR data types on the server are being reported as VARCHAR (DT_STR) to SSIS. This causes problem when importing data as any unicode data that come in causes the package to fail. There's no opportunity to do data conversions here, the package is failing when the data hits the data source component. I can set the component to ignore these errors and it will run fine, but with missing data, which isn't acceptable at all.

I've tried setting the DB_LOCALE and CLIENT_LOCAL in setnet32, doesn't have any effect.

When you create the OLEDB data source it complains about the default code page not being able to be found, so you have to set the property to "AlwyasUseDefaultCodePage" to true for that warning to go away, however setting the default code page doesn't seem to actually change it's behavior, it's still trying to bring this data through as VARCHAR even if I set the code page to something like 65001.

So, my question is, how can I either get the OLEDB driver from Informix working correctly, or set/force SSIS to think this data is actually DT_WSTR, not DT_STR?

Thanks!

Was it helpful?

Solution

So, to summarise the steps required to get this working (for posterities sake at least).

When setting up your OLEDB connection you need to add the 2 parameters -

RSASWS=TRUE;
UNICODE=TRUE;

These 2 parameters are NOT shown in the GUI for the connection, at least with the Informix 4.1 driver.

To add these in you need to modify the "ConnectionString" property of the connection, adding these 2 properties to the end of the connection string. Be aware that this property gets overwritten each time you open the connection GUI. You will need to make sure you modify the connection string manually after each time you enter this interface.

The other option for setting the connection string is using variables (or parameters in SSIS on SQL 2012), so any changes that get automatically made to the connection string will be corrected at run time (they actually get corrected at design time when using parameters).

One final caveat I've found with this data source, is appears to be padding out nvarchar's with empty spaces, as if they were nchar's. This could be an issue with my source data though, but something to check if you setting this up, you may need to add a trim step in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top