CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle DBMS_SQLHASH
Version 11.1
 
General Information
Source {ORACLE_HOME}/rdbms/admin/dbmsobtk.sql
Digest Types (DBMS_CRYPTO)
Digest Type Data Type Value
HASH_MD4 BINARY_INTEGER 1
HASH_MD5 BINARY_INTEGER 2
HASH_SH1 BINARY_INTEGER 3
Dependent Objects
DBMS_CRYPTO DBMS_SQL
DBMS_LOB UTL_RAW
 
GETHASH

Provides an interface to generate the hash value of the result set returned by a SQL query
dbms_sqlhash.gethash(
sqltext     IN VARCHAR2,                 -- input sql statement
digest_type IN BINARY_INTEGER,           -- digest algorithm type
chunk_size  IN NUMBER DEFAULT 134217728) -- 128M
RETURN RAW;
-- To create the all_objs table: Click Here

set serveroutput on

DECLARE
 sqlstr VARCHAR2(4000):='SELECT object_name FROM all_objs WHERE rownum = 1';
 digtype PLS_INTEGER := 3;
 RetVal  RAW(2000);
BEGIN
  SELECT dbms_sqlhash.gethash(sqlstr, dbms_crypto.hash_sh1)
  INTO RetVal
  FROM dual;

  dbms_output.put_line(RetVal);
END;
/
 
Related Topics
DBMS_CRYPTO
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [278 users online]    © 2010 psoug.org