SmallInt UDFs

SmallInt UDFs in Trino

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

ptyProtectSmallInt()

This UDF protects the SmallInt value.

Signature:

ptyProtectSmallInt(smallint input, varchar dataElement)

Parameters:

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

Returns:
This UDF returns the protected SmallInt value.

Example:

select ptyProtectSmallInt(cast(12 as smallint), 'SmallInt_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyProtectSmallInt()Integer - 2 bytesNoNoYesNoYes

ptyUnprotectSmallInt()

This UDF unprotects the protected SmallInt value.

Signature:

ptyUnprotectSmallInt(smallint input, varchar dataElement)

Parameters:

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

Returns:
This UDF returns the unprotected SmallInt value.

Example:

select PtyUnprotectSmallInt(PtyProtectSmallInt(cast(12 as smallint), 'SmallInt_DE'), 'SmallInt_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyUnprotectSmallInt()Integer - 2 bytesNoNoYesNoYes

ptyReprotect() - SmallInt

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

Signature:

ptyReprotect (SmallInt input, varchar oldDataElement, varchar newDataElement)

Parameters:

NameTypeDescription
inputSmallIntSpecifies the SmallInt 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 SmallInt value.

Example:

select ptyReprotect(PtyProtectSmallInt(cast(12 as smallint), 'SmallInt_DE'),'SmallInt_DE','new_SmallInt_DE');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyReprotect()Integer - 2 bytesNoNoYesNoYes

Last modified : December 18, 2025