Showing posts with label unicode. Show all posts
Showing posts with label unicode. Show all posts

Wednesday, March 21, 2012

Problem with Hebrew characters

Hi,

I tried to transfer data from sqlserver2005 to oracle db.

For this, I have to convert some fields before.

I convert unicode data to nonunicode -

from DT_WSTR to DT_STR.

I began to do it with the wizard and the code page is 1252.

My problem is with the hebrew characters.

when there are hebrew characters in the field, it fails.

This is the error output:

"Text was truncated or one or more characters had no match in the target code page."

I tried to change the code page to 1255,

I changed "AlwaysUseDefaultCodePade" to True.

but I can't solve it.

Do you have any experience with it?

Thanks in advance.

Where did you change the code page to 1255? If it's in the Data Conversion transform and you still get the error, then the problem is likely that you have characters in your unicode string that can't be converted. In that case, you'll need to examine that string (try using the error output of the data conversion to get the string) and determine what characters are the cause and how you want to handle it (e.g. fix up or replace the string using another transform before inserting into Oracle). If you're not already using the Data Conversion transform, you could try reading the data in as DT_WSTR and then use the Data Conversion Transform to convert to 1255 to help narrow this problem down.

Another option to try is to do the string conversion outside of SSIS. For example, using a select statement with a cast in the source adapter that reads the data into IS already as DT_STR (the cast outside of IS may fail for the same reason which would also help you narrow this down).

|||

Thank you very much!

I used Data Conversion transform, I changed all of the columns to code page 1255.

In the destination I also set the default code page to 1255, and it works.

Monday, February 20, 2012

Problem with datatypes...

Dear Friends,

I have a problem with datatypes....

The error is "Cannot convert between unicode and non-unicode..."

The column in source is nvarchar(32) and in the destination is varchar(32)... ok...

But in the DataReader Source in the SQLCommand I've converted the column into varchar(32) with

convert(varchar(32), Equities.Equities_Name) as CL_FOLDER_ID

Do you have any tip?

Thanks!

Look at the actual output column for the Source, and you will see that that is DT_WSTR, the unicode string type in SSIS. The DR source does not support non-unicode strings, everything becomes a .Net string in the ADO.Net provider world, and and then SSIS will always treat these as DT_WSTR. If you used the OLE-DB Source through, you get support for both DT_STR and DT_WSTR, mapped from nvarchar and varchar respectively.

So in summary since your source will always give you DT_WSTR, you will need to use a conversion transform inside the pipeline, see Derived Column or Data Conversion, either will do.

|||

Darren,

I used the conversion, but I i tryied to use in SQL command, but if it's not possible, OK... I will use the conversion transform...

Thanks!!