Integer UDFs
This section provides a list of Integer UDFs for both, protect and unprotect operations.
pty_integerins
This UDF protects the Integer data through the tokenization method.
Signature:
pty_integerins(data Integer, dataelement VARCHAR(64))
Parameters:
| Name | Type | Description |
|---|---|---|
| data | Integer | Specifies the data to protect. |
| dataelement | VARCHAR(64) | Specifies the name of the data element. |
Returns:
This UDF returns the protected value as the Integer datatype.
Attention: If the user does not have access to the data in the policy, this UDF returns ‘NULL’.
Exception:
If a data element or a security operation is configured in the policy and the user does not have access, then the function will terminate with an appropriate error message.
Example:
select <database_name>.dbo.pty_integerins(123456,'TE_INT_4');
pty_integersel
This UDF unprotects the protected Integer data through the tokenization method.
Signature:
pty_integersel(data Integer, dataelement VARCHAR(64))
Parameters:
| Name | Type | Description |
|---|---|---|
| data | Integer | Specifies the data to unprotect. |
| dataelement | VARCHAR(64) | Specifies the name of the data element. |
Returns:
This UDF returns the unprotected value as the Integer datatype.
This UDF returns the protected value, if the option is configured in policy and user does not have access to the data.
Attention: If the user does not have access to the data in the policy, this UDF returns ‘NULL’.
Exception:
If a data element or a security operation is configured in the policy and the user does not have access, then the function will terminate with an appropriate error message.
Example:
select <database_name>.dbo.pty_integersel(<database_name>.dbo.pty_integerins(123456, 'TE_INT_4'),'TE_INT_4');
pty_integerenc
This UDF encrypts the Integer data using an encryption data element.
Signature:
pty_integerenc(data Integer, dataelement VARCHAR(64))
Parameters:
| Name | Type | Description |
|---|---|---|
| data | Integer | Specifies the data to protect. |
| dataelement | VARCHAR(64) | Specifies the name of the data element. |
Returns:
This UDF returns the encrypted value as the VARBINARY(8000) datatype.
Attention: If the user does not have access to the data in the policy, this UDF returns ‘NULL’.
Exception:
If a data element or a security operation is configured in the policy and the user does not have access, then the function will terminate with an appropriate error message.
Example:
select <database_name>.dbo.pty_integerenc(1234,'AES256');
In the Example, value=‘AES256’, is the name of the data element.
pty_integerdec
This UDF decrypts the encrypted data that was encrypted using the pty_integerenc UDF.
Signature:
pty_integerdec(data VARBINARY(8000), dataelement VARCHAR(64))
Parameters:
| Name | Type | Description |
|---|---|---|
| data | VARBINARY(8000) | Specifies the data to unprotect. |
| dataelement | VARCHAR(64) | Specifies the name of the data element. |
Returns:
This UDF returns the clear or decrypted value as the INT datatype.
Attention: If the user does not have access to the data in the policy, this UDF returns ‘NULL’.
Exception:
If a data element or a security operation is configured in the policy and the user does not have access, then the function will terminate with an appropriate error message.
Example:
select <database_name>.dbo.pty_integerdec(<database_name>.dbo.pty_integerenc(1234,'AES256'),'AES256');
In the Example, value=‘AES256’, is the name of the data element.
Feedback
Was this page helpful?