Oracle to Teradata Conversion of Char

Database
Enthusiast

Oracle to Teradata Conversion of Char

Hello all:

Teradata's max char length is 64000 characters for LATIN and 32000 characters for UNICODE.

Oracles's max length is 2000 bytes CHAR and NCHAR

If I had a CHAR(2000) column in Oracle what would be the exact equivalent in Teradata (LATIN)?

What about NCHAR(2000) to Teraata (UNICODE)?

And I guess to reverse this if you have a CHAR(64000) in Teradata would you have to store this as a CLOB in Oracle because it doesn't seem to me like CHAR(2000) is enough.

Thanks for the help!
3 REPLIES
Teradata Employee

Re: Oracle to Teradata Conversion of Char

I am not sure if I understand your question.

Teradata does not have an NCHAR data type. It has a CHAR data type but you can specify the Characeter Set:

Char(2000) Character Set LATIN
Char(2000) Character Set Unicode

Enthusiast

Re: Oracle to Teradata Conversion of Char

Hi, thanks for the reply.

But does char(2000) or nchar(2000) both defined in bytes translate to char(2000) character set latin and char(2000) character set unicode in teradata. Or is the teradata data type going to be too small? I'm not sure how the byte to character all works.

Thansk again!
Enthusiast

Re: Oracle to Teradata Conversion of Char

Latin characters take 1 byte each and unicode characters take 2 bytes for each character.
Teradata has a 64000 byte limit for char data types.
So when you declare a column to be LATIN, it can hold upto 64000 characters(1 byte each, so 64K characters, 64KB limit).
When you declare it as UNICODE, it can hold upto 32000 unicode characters(2 bytes each, so 32K characters,64KB limit)
Teradata max limits,
CHAR(64000) CHARACTER SET LATIN
CHAR(32000) CHARACTER SET UNICODE

Oracle CHAR type holds latin characters. upto 2000 characters (size 2000 bytes)
Oracle NCHAR type holds unicode characters. upto 2000 characters(size 4000 bytes)