encrypt_timestamp()
Description
Given a cleartext string in TIMESTAMP datatype format and a keyname, returns its encrypted equivalent.
function encrypt_timestamp (inputdata timestamp, inputKeyname varchar(256)) returns varbyte(16000)
The input string must adhere to BTEQ requirements, such as escaping special characters. For example, if the input string contains an apostrophe, use a double apostrophe: 'It''s a beautiful day'
.
Example
The following example encrypts a timestamp number:
#select encrypt_timestamp(TIMESTAMP '202-03-20 19:22:05', 'ctp-key');
#select encrypt_timestamp(TIMESTAMP '2021-03-20 19:22:05', 'ctp-key');
System Response
*** Query completed. One row found. One column returned.
*** Total elapsed time was 2 seconds.
thales.encrypt_timestamp(TIMESTAMP '2021-03-20 19:22:05', 'ctp-key')
--------------------------------------------------------------------------
E4B5E6FD2C86E2B8F41A92F554ECAA02B5007986DB21BF1A1D95D24F80064107