0

I want to extract the values of the attributes active_ind and call_status from the following string:

<INSURANCE_HISTORY active_ind="Y" call_status="A"/>

I have sorted this issue with substring and instr, but need to use XML commands to extract these values.

1 Answer 1

1

Xpath, xquery, i recommend you to read something about these technology. @ is used to access attribute in xml elment

select extract(xmltype('<INSURANCE_HISTORY active_ind="Y" call_status="A"/>'),'/INSURANCE_HISTORY/@active_ind')  active_ind
, extract(xmltype('<INSURANCE_HISTORY active_ind="Y" call_status="A"/>'),'/INSURANCE_HISTORY/@call_status') call_status

 from dual;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.