Hi All,
One column in m y table can contains string values something like XML nodes with attributes. Here's example:
<tag type="L" value="19" state="in"></tag>
<tag value="20" type="L" state="notIn"></tag>
<tag value="21" state="in" type="X"></tag>
I'm filtering rows which meet following rules:
-begin with '<tag'
-end with '</tag>'
-contain expression 'type="L"'
-contain expression 'state="in"' or 'state="notIn"'
My where clause to filter necessary rows is following:
WHERE SQLCMD LIKE '<tag%</tag>'
AND SQLCMD LIKE '%type="L"%'
AND (SQLCMD LIKE '%state="in"%' OR SQLCMD LIKE '%state="notIn"%');
Such clause will return first two rows from my example.
Now I need to transfrom my long where to just one REGEXP_LIKE condition and check performance impact.
My main problem is to write optional order of mandatory attributes in such reqular expression. Can somebody help me?
I don't preffer using the XML functions like XMLPATH, XMLTYE, EXTRACTVALUE due to slower performance.
thanks