Need to convert UNICODE to LATIN
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Need to convert UNICODE to LATIN Expand / Collapse
Author
Message
Posted 1/6/2006 4:52:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/27/2006 10:38:00 AM
Posts: 3, Visits: 1
I have encountered numerous problems due to differing character sets in my database. The biggest issue encountered is a failure in Informatica ETL when attempting to export data from Teradata. LATIN is the default character set; however certain instances exist where columns default to UNICODE instead.

CREATE TABLE DATABASE.TABLE_A, NO FALLBACK AS
( SELECT 'YES' AS DUMMY_FLAG
FROM TABLE_B
)WITH DATA

or

CREATE TABLE DATABASE.TABLE_A, NO FALLBACK AS
( SELECT CASE WHEN A IS NULL
THEN 'YES'
ELSE 'NO'
END AS DUMMY_FLAG
FROM TABLE_B
)WITH DATA


In certain scripts when a literal is used in the select statement, the column defaults to UNICODE. I need to know how to convert the existing columns back to LATIN, and what can be done to prevent this in the future.

Thanks

Brad




FAST / CHEAP / GOOD

PICK ANY TWO!

Post #3312
Posted 1/8/2006 4:16:57 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 7:20:23 AM
Posts: 533, Visits: 282
SQL Reference: Data Types and Literals
Chapter 2: Data Literals
Character Data Literals

The data type and server character set of a character literal is always VARCHAR(n)
CHARACTER SET UNICODE, where n is the length of the literal.


SELECT
'YES' AS DUMMY_FLAG_U,
type (dummy_flag_U),
TRANSLATE('YES' USING UNICODE_TO_LATIN) AS DUMMY_FLAG,
type (dummy_flag);



Dieter
Post #3319
Posted 1/9/2006 11:19:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/27/2006 10:38:00 AM
Posts: 3, Visits: 1
Thank you Dieter, that is exactly what I needed. This will resolve any future occurances (after I update hundreds of scripts of course).

As for the existing tables, is there a way to ALTER the character set in a table, or is rebuilding every table using this TRANSLATE function the only way? This will work, however many of my tables are just massive.

Thanks again


FAST / CHEAP / GOOD

PICK ANY TWO!

Post #3327
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 5 ( 5 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:04pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Disabled.