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!

Create Hash value for PACKAGE Code

Rene_NBNov 11 2019 — edited Nov 12 2019

Hi,

i have some problems to generate hash Values for my package Code.

Why: I want to generate the hash value form all my packages and store the value into an table. A Day after i store the value again from all my packages, and compare the values und find the packages, wich are changed. I don't want to document how it is changed, only that something is changed in my Packeges.

My idee:

i use the "dbms_metadata.get_ddl" funktion to gett the code, put it in a variable and then i generate the hash value for this variable.

Problems:   

- i can't use "ora_hash", because, the value is by every call different (per definition) :-)

- i cant use Standart_hash, because my packages are to big (more then 32000 character)

-  i can't use " dbms_crypto.hash(utl_raw.cast_to_raw(v_input), dbms_crypto.HASH_MD5)" because the return value is RAW and RAW is to small

          "     22835. 00000 -  "Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: %s, maximum: %s)"

*Cause:    An attempt was made to convert CLOB to CHAR or BLOB to RAW, where

           the LOB size was bigger than the buffer limit for CHAR and RAW

           types.

           Note that widths are reported in characters if character length

           semantics are in effect for the column, otherwise widths are

           reported in bytes.

"

Have anybody an other idea how can i create the Hash values without to cut the packages in a lot off littel peaces?

THX,

René

This post has been answered by Anton Scheffer on Nov 11 2019
Jump to Answer
Comments
Post Details
Added on Nov 11 2019
5 comments
1,515 views