XML parsing using extractvalue method
Hi,
When i use the following data for XML paring its working fine. That is no space inbetween two colons
Query 1:
SELECT ':'||extractValue(x.column_value, '/EMPDETAIL/tranCode')||':' as emp_id
FROM TABLE(
XMLSequence(
Extract( xmltype('<?xml version="1.0" encoding="utf-8"?>
<EMPDETAIL>
<tranCode>008</tranCode>
</EMPDETAIL>'),'/EMPDETAIL'))) x
When i split tranCode tag details as mentioned below format(ie is not in same row) its not working (working but spaces are there between two colons)
Query 2:SELECT ':'||extractValue(x.column_value, '/EMPDETAIL/tranCode')||':' as emp_id
FROM TABLE(
XMLSequence(
Extract( xmltype('<?xml version="1.0" encoding="utf-8"?>
<EMPDETAIL>
<tranCode>
008
</tranCode>
</EMPDETAIL>'),'/EMPDETAIL'))) x
When i use the above data , its taking null value as output and program is raisng exception.
What functionality i have to add in second query so that output of query 2 is same as output of query 1.
Thanks for your help!
Edited by: user601042 on Jan 17, 2011 5:11 AM
Edited by: user601042 on Jan 17, 2011 5:12 AM
Edited by: user601042 on Jan 17, 2011 5:16 AM