SAP Knowledge Base Article - Preview

2604641 - How to insert a node into an existing XML structure using sql statements?

Symptom

How to modify the structure of an existing XML file and add a new node?
For example, if the existing structure is

<XMLInputWorkSchedule>
  <Field1></Field1>
  <Field2></Field2>
  <Field3></Field3>
  <Field4></Field4>
  <Field5></Field5>
  <Field6></Field6>
  <Field7></Field7>
  <Field8></Field8>
</XMLInputWorkSchedule>

how to generate the following one?

<XMLInputWorkSchedule>
   <NewTag>
      <Field1></Field1>
      <Field2></Field2>
      <New Sub Tag2>
         <New Value 2>
           <New Sub Tag 3>
              <New Value 4>xxxx</New Value 4>
           </New Sub Tag 3> 
          <New Value 3>
       </New Sub Tag 2>
     <Field3></Field3>
     <Field4></Field4>
     <Field5></Field5>
     <Field6></Field6>
     <Field7></Field7>
     <Field8></Field8>
   </NewTag>
</XMLInputWorkSchedule>


Read more...

Environment

SAP SQL Anywhere 17
SAP SQL Anywhere 16
SAP SQL Anywhere 12

Product

SAP SQL Anywhere 16.0 ; SAP SQL Anywhere 17.0 ; SAP Sybase SQL Anywhere 12.0

Keywords

Sybase, xmlgen, string, regular expressions , KBA , BC-SYB-SQA-SRV , SQL Anywhere - Server , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.