oh... I was looking for this button for a long time... why not put it on the top of the page.
I actually have 2 questions:
BTEQ -- Enter your SQL request or BTEQ command:
SELECT OCTET_LENGTH('En un lugar de La Mancha...') LENGTH_DEFAULT,
OCTET_LENGTH('En un lugar de La Mancha...', ASCII) LENGTH_ASCII,
OCTET_LENGTH('En un lugar de La Mancha...', UTF8) LENGTH_UTF8,
OCTET_LENGTH('En un lugar de La Mancha...', UTF16) LENGTH_UTF16;
*** Query completed. One row found. 4 columns returned.
*** Total elapsed time was 1 second.
LENGTH_DEFAULT LENGTH_ASCII LENGTH_UTF8 LENGTH_UTF16
-------------- ------------ ----------- ------------
27 27 27 54
2. Collations (sequences) control character ordering and comparison operations during Teradata Database sessions.
For the second question, I agree with you that the collations control the ordering. But how could i know the setting in current session.
For example, If the encoding is ASCII, 'a'(97) is greater than '3'(51) while 'a'(129) is less than '3'(243) if the encoding is EBCDIC. Well, I will do a little researching about this for Teradata.
Setting for current session can be displayed with help session
Here if you need to do comparision then you can set the collation according to your need and then compare. So if you say requirement is to compare EBCDIC values, then you do
SET SESSION COLLATION EBCDIC;
then you can compare values and it will be in that collation sequence.
Hope it helps
And I got another question related.
If the collation is ASCII and I want to compare two characters which are not in the scope of ASCII, how the comparation does? The character will be converted to unicode(assuming the character set is utf8) and then do the comparation? right?