select to_char(substr(eventdata,instr(eventdata,'<ns0:CustomerSiteID>')+20,instr(eventdata,'</ns0:CustomerSiteID>') - instr(eventdata,'<ns0:CustomerSiteID>')-20)) Site,
to_char(substr(eventdata,instr(eventdata,'<ns0:Name>')+10, instr(eventdata,'</ns0:Name>') - instr(eventdata,'<ns0:Name>')-10)) Name,
to_char(substr(eventdata,instr(eventdata,'<ns0:PhoneNumber>')+17, instr(eventdata,'</ns0:PhoneNumber>') - instr(eventdata,'<ns0:PhoneNumber>')-17)) PhoneNumber,
to_char(substr(eventdata,instr(eventdata,'<ns0:AddressLine1>')+18, instr(eventdata,'</ns0:AddressLine1>') - instr(eventdata,'<ns0:AddressLine1>')-18)) AddressLine1,
to_char(substr(eventdata,instr(eventdata,'<ns0:AddressLine2>')+18, instr(eventdata,'</ns0:AddressLine2>') - instr(eventdata,'<ns0:AddressLine2>')-18)) AddressLine2,
to_char(substr(eventdata,instr(eventdata,'<ns0:AddressLine3>')+18,instr(eventdata,'</ns0:AddressLine3>') - instr(eventdata,'<ns0:AddressLine3>')-18)) AddressLine3,
to_char(substr(eventdata,instr(eventdata,'<ns0:AddressLine4>')+18, instr(eventdata,'</ns0:AddressLine4>') - instr(eventdata,'<ns0:AddressLine4>')-18)) AddressLine4,
to_char(substr(eventdata,instr(eventdata,'<ns0:POBoxNo>')+13,instr(eventdata,'</ns0:POBoxNo>') - instr(eventdata,'<ns0:POBoxNo>')-13)) POBoxNo,
to_char(substr(eventdata,instr(eventdata,'<ns0:City>')+10, instr(eventdata,'</ns0:City>') - instr(eventdata,'<ns0:City>')-10)) City,
to_char(substr(eventdata,instr(eventdata,'<ns0:State>')+11, instr(eventdata,'</ns0:State>') - instr(eventdata,'<ns0:State>')-11)) State,
to_char(substr(eventdata,instr(eventdata,'<ns0:ZipCode>')+13, instr(eventdata,'</ns0:ZipCode>') - instr(eventdata,'<ns0:ZipCode>')-13)) ZipCode,
to_char(substr(eventdata,instr(eventdata,'<ns0:Country>')+13, instr(eventdata,'</ns0:Country>') - instr(eventdata,'<ns0:Country>')-13)) Country,
to_char(e.Created_date,'mm/dd/yy hh24:mi:ss') CreateDt,
(ed.ERRORMSG) ErrorMsg
from exception e, exception_detail ed
where e.jmsid = ed.jmsid
and ((upper(e.componentname) like '%SITE%') or (upper(e.componentname) like 'CUSTMAST%'))
and (e.timeoccured) between to_date('11/29/06 08:58','mm/dd/yy hh24:mi:ss')
and to_date('11/29/06 09:18','mm/dd/yy hh24:mi:ss')
and ed.ERRORMSG NOT LIKE '%Integrity constraint%'
and ed.ERRORMSG NOT LIKE '%TNS%'
and ed.ERRORMSG NOT LIKE '%cancel%'
and ed.ERRORMSG NOT LIKE '%Reply%'
and ed.ERRORMSG NOT LIKE '%Site Update Service.process/Wait fo%'
and ed.ERRORMSG NOT LIKE '%Wait fo%'
and ed.ERRORMSG NOT LIKE '%Site Upsert/Site Create Service.process/Wait fo%'
ORDER BY 1, 3