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!

extract xml "like" data from a clob

user2609480Apr 13 2016 — edited Apr 13 2016

Hi,

My sql skills are not strong, so I'm looking for some help around how to extract a specific value from a database column that is stored as a club that is xml "like", but not pure xml.

The information is stored in the column like so:

<map>

  <entry>

    <string>Premises_Type</string>

    <string></string>

  </entry>

  <entry>

    <string>Title</string>

    <string>true</string>

  </entry>

  <entry>

    <string>CONFIG&#x1;street_address&#x1;Enabled</string>

    <string>true</string>

  </entry>

</map>

And I'm looking to extract the values Title = True and ignore everything else. The order of the "<entry>" elements can change on each row.

Does anyone have any suggestions about the best way to achieve this? I've tried using extractvalue xmltype which fails with a malformed xml (probably from the ';' and maybe lack of proper xml tags). I can't perform any validation before this data goes in to the table.

Any help or pointers would be appreciated.

Thanks!

This post has been answered by Etbin on Apr 13 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2016
Added on Apr 13 2016
8 comments
1,942 views