special characters length truncation

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Define your column as NVarchar(10) or use an unbounded Varchar. The length for VarChar specifies maximum number of bytes. The length of NVarchar specifies maximum number of characters. UTF-8 characterset has variable-length characters... so 10 characters can exceed 10 bytes.

I prefer unbounded Varchar for UTF-8 when most characters are a single byte. I prefer NVarchar when most characters are multi-byte.

Mike
harikhk
Participant
Posts: 64
Joined: Tue Jun 04, 2013 11:36 am

Post by harikhk »

Have come across the same problem.Using Nvarchar solved the problem
Thanks,
HK
*Go GREEN..Save Earth*
bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Post by bart12872 »

I understand Mike. My issue in fact is that my database at the end is Varchar(10 bytes). and cause me trouble.

Thank you very much mike
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

In oracle it can be defined as Varchar2(10 char) and NLS_LENGTH_SEMANTICS also plays a role there. The string you posted in there has 11 bytes, If changing length that it not possible, how are you planning to accommodate 11 bytes to a 10 byte field?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply