Extract from XML string
Greetings all,
I am trying to extract value from an XML, I think I need to use Regex substr but unsure how.
I am trying to extract value between <inActiveFlg> so far I have this:
execute:
select substr('<latestBoStatus>ACTIVE</latestBoStatus><inActiveFlg>false</inActiveFlg><Min>80</Min><Max>105</Max>',instr('<latestBoStatus>ACTIVE</latestBoStatus><inActiveFlg>false</inActiveFlg><Min>80</Min><Max>105</Max>','<inActiveFlg>',1,1)+1)from dual;
returns:
false
but if change the query with a true value it returns:
true<
sometimes the tag <inActiveFlg >will not be present as well, how can I fix this query to only show false or true when tag is present?