nvarchar and ntext

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
srinivas_dsx
Premium Member
Premium Member
Posts: 7
Joined: Thu Nov 17, 2005 12:00 pm

nvarchar and ntext

Post 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
NBALA
Participant
Posts: 48
Joined: Tue Jul 11, 2006 11:52 am
Location: IL, USA

Re: nvarchar and ntext

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
srinivas_dsx
Premium Member
Premium Member
Posts: 7
Joined: Thu Nov 17, 2005 12:00 pm

Post 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
Post Reply