15.10 - EBCDIC - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

The collation is EBCDIC for an IBM mainframe-attached host.

Example: Setting a Session to Use the EBCDIC Collation Sequence

If the same session from Example: Effect of the ASCII Collation Sequence on SQL Report Output is then set to EBCDIC collation as follows.

     SET SESSION COLLATION EBCDIC; 

The same SQL request produces the following report, sorting job_id in the ascending order defined for EBCDIC.

     EmpNo       JobId
     ------    --------
     10004      ENG-000
     10016      ENG-0002
     10004      ENG-0003
     10003      OE1-0001
     10001      PAY-0002
     10201      1001-AP2
     10201      1032-AR3
     10201      1031-AR2

Example: Effect of the EBCDIC Collation Sequence on SQL Report Output

If the descending option is specified for the query in Example: Setting a Session to Use the EBCDIC Collation Sequence in place of the default sort direction, which is ascending, the following report is produced, sorting job_id in descending EBCDIC order.

     SELECT emp_no, job_id 
     FROM job_rept 
     ORDER BY job_id DESC;
     emp_no       job_id
     ------     --------
     10201      1031-AR2
     10201      1032-AR3
     10201      1001-AP2
     10001      PAY-0002
     10003      OE1-0001
     10004      ENG-0003
     10004      ENG-0002
     10016      ENG-0002