I have column RESPONSE_XML and REQUEST_XML
which consist of large string. I have used substring function for this large string in order to fetch the SUBSCRIPTION_ID from RESPONSE_XML and orderType from REQUEST_XML. The query is working fine. But now i want to put condition for this query such that it should only return SUBSCRIPTION_ID where orderType='NEW'
. I store the result of both the Substring into alias and used these alias in where condition. But its not working and giving error as ORA-01722 Invalid numnber
. Here is my query :
SELECT REPLACE(REPLACE(REGEXP_SUBSTR(RESPONSE_XML, '<ax2147:subscriptions xsi:type="ax2127:SubscriptionDTO"><ax2130:id>\d+</ax2130:id>'),
'<ax2147:subscriptions xsi:type="ax2127:SubscriptionDTO"><ax2130:id>', ''), '</ax2130:id>', '')
AS SUBSCRIPTION_ID ,
REPLACE(REPLACE(REGEXP_SUBSTR(REQUEST_XML, '<ns7:orderType>\d+</ns7:orderType>'), '<ns7:orderType>', ''), '</ns7:orderType>', '')
AS order_type
FROM
SOAP_MONITORING
where WEB_SERVICE_NAME='RatorWebShopService' and WEB_METHOD_NAME='placeShopOrder'
and order_type='NEW' order by CREATE_DATE desc
I also tried a query in this way but result an error i.e ORA-00932 inconsistent datatype at line 10
SELECT REPLACE(REPLACE(REGEXP_SUBSTR(RESPONSE_XML, '<ax2147:subscriptions xsi:type="ax2127:SubscriptionDTO"><ax2130:id>\d+</ax2130:id>'),
'<ax2147:subscriptions xsi:type="ax2127:SubscriptionDTO"><ax2130:id>', ''), '</ax2130:id>', '')
AS SUBSCRIPTION_ID from SOAP_MONITORING
where
REQUEST_XML
in
(
REPLACE(REPLACE(REGEXP_SUBSTR(REQUEST_XML, '<ns7:orderType>\d+</ns7:orderType>'), '<ns7:orderType>', ''), '</ns7:orderType>', '')
)
and WEB_SERVICE_NAME='RatorWebShopService' and WEB_METHOD_NAME='placeShopOrder' and REQUEST_XML='NEW'