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 replace word in long raw data type column

NSK2KSNAug 26 2016 — edited Sep 14 2016

Hi,

we have a table nsk_log which is having a column XML1 of LONG RAW data type.

'<JAVAOBJECT_XML> <!-- This is test data, Inc. Copyright 2003. All Rights Reserved. --> </JAVAOBJECT_XML>' is inserted as data into XML1

now our requirement is to replace test with prod in this data.

Expected output is

'<JAVAOBJECT_XML> <!-- This is prod data, Inc. Copyright 2003. All Rights Reserved. --> </JAVAOBJECT_XML>'

CREATE TABLE nsk_long

  (XML1 LONG RAW

  );

INSERT INTO nsk_long

SELECT rawtohex('<JAVAOBJECT_XML>

<!-- This is test data, Inc. Copyright 2003. All Rights Reserved. -->

</JAVAOBJECT_XML>')

FROM dual;

COMMIT;

when I do select * from nsk_long in sql developer, am getting below as output

3C4A4156414F424A4543545F584D4C3E0A3C212D2D2054686973206973207465737420646174612C20496E632E20436F7079726967687420323030332E20416C6C205269676874732052657365727665642E202D2D3E0A3C2F4A4156414F424A4543545F584D4C3E

Please let me know pointers.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2016
Added on Aug 26 2016
10 comments
3,467 views