DB2 10.5 for Linux, UNIX, and Windows

GETHINT scalar function

The GETHINT function will return the password hint if one is found in the encrypted-data.

Read syntax diagramSkip visual syntax diagram
>>-GETHINT--(--encrypted-data--)-------------------------------><

The schema is SYSIBM.

A password hint is a phrase that will help data owners remember passwords; for example, 'Ocean' as a hint to remember 'Pacific'. In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed.

encrypted-data
An expression that returns a CHAR FOR BIT DATA or VARCHAR FOR BIT DATA value that is a complete, encrypted data string. The data string must have been encrypted using the ENCRYPT function (SQLSTATE 428FE).

The result of the function is VARCHAR(32 OCTETS). The result can be null; if the hint parameter was not added to the encrypted-data by the ENCRYPT function or the first argument is null, the result is the null value.

Example

In this example the hint 'Ocean' is stored to help the user remember the encryption password 'Pacific'.
   INSERT INTO EMP (SSN) VALUES ENCRYPT('289-46-8832', 'Pacific','Ocean');
   SELECT GETHINT(SSN)
     FROM EMP;
The value returned is 'Ocean'.