Integer UDFs

Integer UDFs in Trino

This section provides a list of the integer UDFs for the protect, unprotect, and reprotect operations.

ptyProtectInt()

This UDF protects the Int value.

Signature:

ptyProtectInt(Int input, varchar dataElement)

Parameters:

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

Returns:
This UDF returns the protected Int value.

Example:

select ptyProtectInt(1234567, 'Int_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyProtectInt()Integer - 4 bytesNoNoYesNoYes

ptyUnprotectInt()

This UDF unprotects the protected Int value.

Signature:

ptyUnprotectInt(int input, varchar dataElement)

Parameters:

NameTypeDescription
inputIntSpecifies the protected data to unprotect.
dataElementVarCharSpecifies the name of the data element to unprotect the data.

Returns:
This UDF returns the unprotected Int value.

Example:

select ptyUnprotectInt(ptyProtectInt(1234567, 'Int_DE'), 'Int_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyUnprotectInt()Integer - 4 bytesNoNoYesNoYes

ptyReprotect() - Int

This UDF reprotects the Int format protected data, which was earlier protected using the ptyProtectInt UDF, with a different data element.

Signature:

ptyReprotect(int input, varchar oldDataElement, varchar newDataElement)

Parameters:

NameTypeDescription
inputIntSpecifies the Int 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 Int value.

Example:

select ptyReprotect(ptyProtectInt(1234567, 'Token_Integer'), 'Token_Integer','new_Token_Integer');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyReprotect()Integer - 4 bytesNoNoYesNoYes

Last modified : December 18, 2025