Select data from XMLType column [message #575618] |
Thu, 24 January 2013 15:29 |
|
sqlsatya
Messages: 10 Registered: December 2012
|
Junior Member |
|
|
I have a table Table_xml_tmp which has a column MESSAGECONTENTS as XMLType data which contains data as follows
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xclimSchemaMain xmlns="http://clones.telcordia.com">
<response>
<clHeader>
<msgName>queryPlace</msgName>
<object>CLLICode</object>
<msgType>RESPONSE</msgType>
<sender>CLONES</sender>
<senderInstance>[url]http://directcodecenter.commonlanguage.com[/url]</senderInstance>
<operationStatus>SUCCESS</operationStatus>
<correlationId>1358984262589clon2861349949B3920BB9A397201387788AD50E295733560</correlationId>
<additionalInfo>
<returnStatus>
<return Code>Success</returnCode>
</returnStatus>
</additionalInfo>
</clHeader>
<clData>
<list>
<searchString>queryPlace for CHAMBLEE in GA, USA</searchString>
<searchScope></searchScope>
<stateName>GEORGIA</stateName>
<countryCode>USA</countryCode>
<siteInfo>
<clliCode>CHMBGA</clliCode>
<status>A</status>
<placeName>CHAMBLEE</placeName>
<normalizedPlaceName>CHAMBLEE</normalizedPlaceName>
<placeType>CITY</placeType>
<countyName>DEKALB</countyName>
<lata>438</lata>
</siteInfo>
</list>
</clData>
</response>
</xclimSchemaMain>
"
I need to get all rows where node <operationStatus> value as SUCCESS
I am running following query but it is returning null value insted of data of columns
SELECT a.MESSAGECONTENTS.extract('/clHeader/msgName/object/msgType/sender/senderInstance/operationStatus/text()').getStringVal()
FROM Table_xml_tmp a
WHERE a.MESSAGECONTENTS.extract('/clHeader/msgName/object/msgType/sender/senderInstance/operationStatus/text()').getStringVal()= 'SUCCESS'
Please suggest what changes required
[mod-edit: code tags added by bb; next time please add them yourself]
[Updated on: Thu, 24 January 2013 17:46] by Moderator Report message to a moderator
|
|
|
|
|