Skip to Main Content

Oracle Database Discussions

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!

Update column with hash values

PVMFeb 5 2014 — edited Feb 6 2014

Hi All,

I have a requirement to add a column to a table and populate with hash values. The table contains one xml column and need hash value of that column to be populated to newly added column. I think ora_hash function will not support xml type column. Just tested with the following script and it works.

update TBL_COMPONENT_XSL set hash_val = ora_hash((SELECT TCX.COMPONENT_XSL.getStringVal() FROM TBL_COMPONENT_XSL TCX where rownum =1));

can you please suggest me how to populate the column with hash values.

SQL> desc TBL_COMPONENT_XSL

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

COMPONENT_XSL_ID                          NOT NULL NUMBER(18)

LINE_OF_BUSINESS                          NOT NULL VARCHAR2(30)

ORDER_SOURCE                              NOT NULL VARCHAR2(10)

COMPONENT_NAME                            NOT NULL VARCHAR2(30)

COMPONENT_SCHEMA_VERSION                  NOT NULL NUMBER(9)

ACCESS_LEVEL                              NOT NULL VARCHAR2(30)

COMPONENT_XSL                             NOT NULL SYS.XMLTYPE STORAGE BINARY

DESCRIPTION                               NOT NULL VARCHAR2(200)

HASH_VAL                                           NUMBER

HASH_VAL is the newly added column.

Thanks,

Mani

This post has been answered by Girish Sharma on Feb 6 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2014
Added on Feb 5 2014
7 comments
4,328 views