I'm developing an SSIS package to extract data from a table in an Oracle 11g database and load it to a table in a SQL Server 2014 database.
The table in the Oracle database has string columns defined as VARCHAR2 (single byte / codepage 8859-1); the table in the SQL Server database has string columns defined as VARCHAR (single byte).
However, when I add an OLE DB source / ADO .NET source to the SSIS package and configure it to select columns from the table in the Oracle source, the External Columns (Advanced Editor) shows the string columns as DT_WSTR (Unicode).
This Oracle article (see section 'How Oracle Unicode Support Works') advises that "When the client character set is not a superset of the server character set or the database character set is a multibyte character set, OraOLEDB automatically enables the Unicode mode."
How do I get the OraOLEDB provider / SSIS OLE DB data source to expose the string columns in the source as single byte?
LocaleID = English (United Kingdom)
SELECT * FROM V$SESSION_CONNECT_INFO
SELECT * FROM SYS.NLS_DATABASE_PARAMETERS
As you already noted, "unicode mode" is used by the Oracle client when your client's character set is not a superset of the database's. The database's character set is definitely WE8ISO8859P1. Your client's character set is yet undetermined. The client session connection info is not a reliable source.
The environment variable NLS_LANG overrides a registry setting, if any. To make sure that the OraOLEDB client uses the desired NLS_LANG value, ensure that the user that executes the SSIS package has that environment variable set. You can realise this e.g. by editing HKEY_USERS\<that user's id>\Environment\NLS_LANG. I suggest starting with making it equal to the database, WE8ISO8859P1, to rule out that WE8MSWIN1252 is not regarded as a superset by the Oracle client.
Excellent article on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With