Unicode UDFs

Unicode UDFs in Trino

This section provides a list of Unicode UDFs for the protect, unprotect, and reprotect operations. This UDF should be used only to tokenize the Unicode data in Trino, migrate the tokenized data from Trino to a Teradata database, and detokenize the data using the Protegrity Database Protector. Ensure to use this UDF with a Unicode tokenization data element only.

ptyProtectUnicode()

This UDF protects the Varchar (Unicode) values.

Signature:

ptyProtectUnicode(varchar input, varchar dataElement)

Parameters:

NameTypeDescription
inputVarCharSpecifies the data to protect.
dataElementVarCharSpecifies the name of the data element to protect the data.

Returns:
This UDF returns the protected Varchar value.

Example:

select ptyProtectUnicode('ProtegrityProt','Unicode_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyProtectUnicode()Unicode (Legacy)
Unicode Base64
NoNoYesNoYes

ptyUnprotectUnicode()

This UDF unprotects the existing protected string value. This UDF should be used only to tokenize the Unicode data in Trino, migrate the tokenized data from Trino to a Teradata database, and detokenize the data using the Protegrity Database Protector. Ensure to use this UDF with a Unicode tokenization data element only.

Signature:

ptyUnprotectUnicode(varchar input, varchar dataElement)

Parameters:

NameTypeDescription
inputVarCharSpecifies the data to unprotect.
dataElementVarCharSpecifies the name of the data element to unprotect the data.

Returns:
This UDF returns the unprotected Varchar(Unicode) value.

Example:

select ptyUnprotectUnicode(ptyProtectUnicode('ProtegrityProt','Unicode_DE'),'Unicode_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyUnprotectUnicode()Unicode (Legacy)
Unicode Base64
NoNoYesNoYes

ptyReprotectUnicode()

This UDF reprotects the Varchar format protected data, which was earlier protected using the ptyProtectUnicode() UDF, with a different data element. This UDF should be used only to tokenize the Unicode data in Trino, migrate the tokenized data from Trino to a Teradata database, and detokenize the data using the Protegrity Database Protector. Ensure to use this UDF with a Unicode tokenization data element only.

Signature:

ptyReprotectUnicode(varchar input, varchar oldDataElement, varchar newDataElement)

Parameters:

NameTypeDescription
inputVarCharSpecifies the Varchar(Unicode) value to reprotect.
oldDataElementVarCharSpecifies the name of the data element that was initially used to protect the data.
newDataElementVarCharSpecifies the name of the new data element to reprotect the data.

Returns:
This UDF returns the protected VarChar value.

Example:

select ptyReprotectUnicode(ptyProtectUnicode('ProtegrityProt','Unicode_DE'),'Unicode_DE','new_Unicode_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyReprotectUnicode()Unicode (Legacy)
Unicode Base64
NoNoYesNoYes

Last modified : December 18, 2025