sql >> Databasteknik >  >> RDS >> Oracle

Analysera XML-kommentarer i Oracle

En kombination av replace , extract och och xpath-uttryck skulle kunna göra:

select 
replace(replace(
extract(
xmltype (q'{<?xml version="1.0" encoding="utf-8"?> 
<!--ADOR Acknowledgement 2-->  
<AckTransmission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.irs.gov/efile">
<TransmissionHeader recordCount="1">  
<Jurisdiction>ALABAMA</Jurisdiction>  
<TransmissionId>1946157056</TransmissionId>    
<Timestamp>2012-08-16T01:25:47-05:00</Timestamp> 
<Transmitter>      
  <ETIN>00000</ETIN>     
</Transmitter>  
<ProcessType>T</ProcessType>  
<AgentIdentifier>ACK</AgentIdentifier> 
</TransmissionHeader> 
<Acknowledgement> 
  <SubmissionId>X1684956672</SubmissionId> 
  <EFIN>X16849</EFIN>  
  <GovernmentCode>ALST</GovernmentCode> 
  <SubmissionType>XMLTOM</SubmissionType>
  <TaxYear>9999</TaxYear>  
  <SubmissionCategory>MFET</SubmissionCategory>   
  <AcceptanceStatus>A</AcceptanceStatus>  
  <ContainedAlerts>0</ContainedAlerts>    
  <StatusDate>2012-08-16</StatusDate>   
</Acknowledgement> 
</AckTransmission>}'),
'/descendant::comment()'
), '<!--'), '-->') as comment_
from dual;


  1. Simulerande fördröjningsfunktion på MySQL

  2. PG::ConnectionBad:fe_sendauth:inget lösenord tillhandahålls

  3. LibreOffice:'com.mysql.jdbc.driver' kan inte laddas

  4. Ställa in Active Data Guard Physical Standby i RAC One Node Architecture – Del 2