Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to calculate HASH_VALUE for Specific SQL

473726Dec 2 2005 — edited Dec 2 2005
I have an auditing trigger and want to filter out known statements.
I can, from within the trigger, obtain the SQL that fired the trigger (dbms_standard.sql_txt function).
I want to be able to calculate the HASH_VALUE for this SQL to use in a decision tree.

If I have auditing enabled (I do) I can use the audsid {sys_context('USERENV','SESSIONID')} to lookup my SID and from there peruse several V$ views. This seems rather cumbersome.

Does anyone know of a built-in function to either calculate the HASH_VALUE, when given SQL_TEXT or to return the HASH_VALUE for the firing SQL statement?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2005
Added on Dec 2 2005
4 comments
327 views