Page 1 of 1

nvarchar and ntext

Posted: Fri Aug 25, 2006 12:10 pm
by srinivas_dsx
I am sure this topic is discussed before or it is very elementary, however, I am trying to understand how would one handle ntext (16) in a unicode database/application in Datastage. I tried nvarchar with NLS enabled (UTF8) and its works fine in datastage wherever the string length is less than 2000, but warns when it is more than 2000 characters.

I would appreciate if someone please advice the concept of ntext how should I handle this situation.

Thanks.

Srinivas

Re: nvarchar and ntext

Posted: Fri Aug 25, 2006 1:19 pm
by NBALA
There is one way to do this, we did everything in SQL server side using "Stuff" function. Using this function you can strip out the unwanted charaters like all the RTF formatting crap. Then load the converted data.

Alternatively you can try NCHAR and NVARCHAR2. These are used to store fixed-length and varying-length national character strings. Beginning with Oracle9i, they were redefined to be Unicode-only data types and can hold up to 2,000 and 4,000 characters (not bytes!) correspondingly. That means if you declare a column to be CHAR(100) it will allocate 100 bytes per column, but NCHAR(100) Unicode-based column requires 200 bytes.

-NB

Posted: Fri Aug 25, 2006 11:14 pm
by ray.wurlod
Ha, another one brainwashed by Oracle bin Larry! VARCHAR2 only exists in Oracle - the OP made no mention of Oracle.

NVarChar (the "Standard" representation) does use two bytes per character.

You (srinivas_dsx, and welcome aboard) can try using Long NVarChar for larger data. Or change the data type to VarChar (which will allow up to 4000 characters).

Posted: Tue Aug 29, 2006 1:05 pm
by srinivas_dsx
ray.wurlod wrote:Ha, another one brainwashed by Oracle bin Larry! VARCHAR2 only exists in Oracle - the OP made no mention of Oracle.

NVarChar (the "Standard" representation) does use two bytes per character.

You (srinivas_dsx, and welcome aboard) can try using Long NVarChar for larger data. Or change the data type to VarChar (which will allow up to 4000 characters).
Ray,

Thanks, I will use method you suggested and see what happens.

Srinivas