17.20 - Example: Using Pass Through Character Literals - Analytics Database - Teradata Vantage

Teradata Vantageā„¢ - Analytics Database International Character Set Support - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-01-27
dita:mapPath
aju1628095815656.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
hqj1472245413611

This example shows how you can use pass through character (PTC) literals in a session with Unicode Pass Through enabled. The PTC literals are emoji characters, and the session character set is UTF16.

To run these examples, replace the emoji graphics with the corresponding Unicode code points (such as U+1F601) inserted using your client application.

/**********************************************************************/
/* Enable Unicode Pass Through                                        */
/**********************************************************************/

SET SESSION CHARACTER SET UNICODE PASS THROUGH ON;
/**********************************************************************/
/* CREATE TABLE                                                       */
/**********************************************************************/

CREATE TABLE upt_tbl0
(
  col1    INTEGER,
  col2    VARCHAR(6) CHARACTER SET UNICODE
) UNIQUE PRIMARY INDEX (col1);
/**********************************************************************/
/* Insert Pass Through Characters into the table                      */
/**********************************************************************/

/* U+1F601 = GRINNING FACE WITH SMILING EYES */

INSERT INTO upt_tbl0 VALUES (1, '');

/* U+1F602 = FACE WITH TEARS OF JOY */

INSERT INTO upt_tbl0 VALUES (2, '');

/* U+1F603 = SMILING FACE WITH OPEN MOUTH */

INSERT INTO upt_tbl0 VALUES (3, '');

/* U+1F604 = SMILING FACE WITH OPEN MOUTH AND SMILING EYES */

INSERT INTO upt_tbl0 VALUES (4, '');

/* U+1F605 = SMILING FACE WITH OPEN MOUTH AND COLD SWEAT */

INSERT INTO upt_tbl0 VALUES (5, '');

/**********************************************************************/
/* DISPLAY ROWS                                                       */
/**********************************************************************/

SELECT '';

Result:

''

-----

SELECT * FROM upt_tbl0 WHERE col2 = '';

Result:



SELECT * FROM upt_tbl0 ORDER BY col2;

Result: