title: How to remove a node from XML in Oracle?
body: <p>I want to remove a node from a XML in Oracle. I am facing a problem  during deleting a node:</p>
  
  <p>Below is my XML:</p>
  
  <pre><code>    &lt;/TRB_TRX&gt;
  &lt;DATA&gt;
          &lt;Request APIType="null"&gt;
              &lt;SubscriberIdsInfo&gt;
                  &lt;ExternalId&gt;
                      &lt;ExternalId&gt;8034204058&lt;/ExternalId&gt;
                  &lt;/ExternalId&gt;
                  &lt;SubscriberId&gt;
                      &lt;SubscrNumber/&gt;
                  &lt;/SubscriberId&gt;
              &lt;/SubscriberIdsInfo&gt;
              &lt;Services&gt;
                  &lt;Soc&gt;88371664&lt;/Soc&gt;
                  &lt;ServiceAgreementSequenceNo/&gt;
                  &lt;DealerCode/&gt;
                  &lt;DeployMode/&gt;
                  &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                  &lt;ExpirationDate/&gt;
                  &lt;OfferInstanceId/&gt;
              &lt;/Services&gt;
              &lt;Services&gt;
                  &lt;Soc&gt;911143659&lt;/Soc&gt;
                  &lt;ServiceAgreementSequenceNo/&gt;
                  &lt;DealerCode/&gt;
                  &lt;DeployMode/&gt;
                  &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                  &lt;ExpirationDate/&gt;
                  &lt;OfferInstanceId/&gt;
              &lt;/Services&gt;
              &lt;Services&gt;
                  &lt;Soc&gt;42132&lt;/Soc&gt;
                  &lt;ServiceAgreementSequenceNo/&gt;
                  &lt;DealerCode/&gt;
                  &lt;DeployMode/&gt;
                  &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                  &lt;ExpirationDate/&gt;
                  &lt;OfferInstanceId/&gt;
              &lt;/Services&gt;
              &lt;SubParameters&gt;
                  &lt;Name&gt;PoolID&lt;/Name&gt;
                  &lt;Values&gt;B287024769280MDVCPOOL&lt;/Values&gt;
                  &lt;EffectiveDate&gt;2014-10-16T14:08:37&lt;/EffectiveDate&gt;
                  &lt;ExpirationDate/&gt;
              &lt;/SubParameters&gt;
              &lt;ActivityInfo/&gt;
          &lt;/Request&gt;
      &lt;/DATA&gt;
  &lt;/TRB_TRX&gt;
  </code></pre>
  
  <p>I want to remove below</p>
  
  <pre><code>    &lt;Services&gt;
                  &lt;Soc&gt;88371664&lt;/Soc&gt;
                  &lt;ServiceAgreementSequenceNo/&gt;
                  &lt;DealerCode/&gt;
                  &lt;DeployMode/&gt;
                  &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                  &lt;ExpirationDate/&gt;
                  &lt;OfferInstanceId/&gt;
              &lt;/Services&gt;
              &lt;Services&gt;  
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    &lt;Services&gt;
                      &lt;Soc&gt;88371664&lt;/Soc&gt;
                      &lt;ServiceAgreementSequenceNo/&gt;
                      &lt;DealerCode/&gt;
                      &lt;DeployMode/&gt;
                      &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                      &lt;ExpirationDate/&gt;
                      &lt;OfferInstanceId/&gt;
                  &lt;/Services&gt;
                  &lt;Services&gt;
  </code></pre>
  
  <p>my final output should be like below</p>
  
  <pre><code>    &lt;/TRB_TRX&gt;
          &lt;DATA&gt;
              &lt;Request APIType="null"&gt;
                  &lt;SubscriberIdsInfo&gt;
                      &lt;ExternalId&gt;
                          &lt;ExternalId&gt;8034204058&lt;/ExternalId&gt;
                      &lt;/ExternalId&gt;
                      &lt;SubscriberId&gt;
                          &lt;SubscrNumber/&gt;
                      &lt;/SubscriberId&gt;
                  &lt;/SubscriberIdsInfo&gt;
                  &lt;Services&gt;
                      &lt;Soc&gt;911143659&lt;/Soc&gt;
                      &lt;ServiceAgreementSequenceNo/&gt;
                      &lt;DealerCode/&gt;
                      &lt;DeployMode/&gt;
                      &lt;EffectiveDate&gt;2014-10-16T00:00:00&lt;/EffectiveDate&gt;
                      &lt;ExpirationDate/&gt;
                      &lt;OfferInstanceId/&gt;
                  &lt;/Services&gt;
                  &lt;SubParameters&gt;
                      &lt;Name&gt;PoolID&lt;/Name&gt;
                      &lt;Values&gt;B287024769280MDVCPOOL&lt;/Values&gt;
                      &lt;EffectiveDate&gt;2014-10-16T14:08:37&lt;/EffectiveDate&gt;
                      &lt;ExpirationDate/&gt;
                  &lt;/SubParameters&gt;
                  &lt;ActivityInfo/&gt;
              &lt;/Request&gt;
          &lt;/DATA&gt;
      &lt;/TRB_TRX&gt;
  </code></pre>
  
  <p>I am using below SQL query</p>
  
  <pre><code>UPDATE trb1_sub_errs SET general_data = deleteXML(general_data,'//DATA/Request/Services[1]') where SUB_TRX_ID=1242403029;
  </code></pre>
  
  <p>Below error I am getting </p>
  
  <pre><code>ERROR at line 1:
  ORA-00932: inconsistent datatypes: expected - got CHAR
  </code></pre>