How to grab values between xml in SQl statement

58 views Asked by At

When I run a SQL against one of the tables, this is the value i get against column instruction

<GiftMessage>
  <Properties>
    <Property Type="FONT">50</Property>
    <Property Type="SCRIPT">512</Property>
    <Property Type="CARD">B</Property>
    <Property Type="FORMATOPTION">N</Property>
    <Property Type="WRTIE">D</Property>
  </Properties>
  <Line SeqNo="1"><![CDATA[]]></Line>
  <Line SeqNo="2"><![CDATA[]]></Line>
  <Line SeqNo="3"><![CDATA[]]></Line>
  <Line SeqNo="4"><![CDATA[            ***712020line2***]]></Line>
</GiftMessage>

How do i grab the value "712020line2" alone from the column to show in my output query using select statement.

Apologize for late reply, I am connected to Oracle database using Oracle sql developer, and below is the query we run.

select instruction_text,order_no from INSTRUCTION_DETAIL where instruction_text like '%712020%';

Purpose We used to place around 50-70 orders and share it with different team for shipment, updating each order on what needs to be done is tedious task, so we are planning to update that instruction with "what action the shipment team needs to do", so at the end of day, we just run this query and download it to excel and share. But the thing is the instruction_text column value comes out in an xml format, so looking for a way to fetch only the instruction text, like in above case, '712020line2', from that xml

0

There are 0 answers