A hash key is generated based on a statement’s text, and acts as an approximate key for the search mechanism in the statement cache. Since other monitoring tables display the statement’s text, you can use the hash key as an approximate key to look up and compare SQL text in these tables.
For information about viewing the entire SQL text of a cached statement, see “Displaying text and parameter information for cached statements,” below.
Adaptive Server includes two functions you can use to effectively compute the hash key. Use parse_text to verify the validity of the SQL text before computing the hash key. The syntax is:
select parse_text(text, prm_opt)
Valid values for prm_opt are:
1 – indicates that parse_text will auto-parameterize the output text.
-1 – indicates that the current session settings for literal parameterization determine whether the input text is parameterized.
If the SQL text is invalid, the parse_text function returns null.
Use hashbytes to compute the hash key over the statement’s text. For example:
select hashbytes('xor32', 'select * from syskeys')