Siebel Analytics Web Administration Guide > Administering Siebel Intelligence Dashboards > Configuring Report Write Back >

Creating a Write Back Template


The write back template is an XML-formatted file that contains SQL commands needed to insert and update records in the write back table and columns you have created. You can create multiple write back templates, customizing each one for the fields used in each specific report. In the report properties you specify the name of the write back template to use. Put the write back template files in the CustomMessages folder.

To meet security requirements, you must specify the connection pool along with the SQL commands to insert and update records. This SQL references the values passed in the write-back schema to generate the SQL statements to modify the database table. Values can be referenced either by position (such as @1, @3) or by column ID (@{c0}, @{c2}). Column positions start numbering with 1, whereas column IDs start with c0. The use of Column ID is preferred.

NOTE:  The notation @n is not the same as @{cn-1}, because the column with ID cn-1 may not be the nth column in the table.

If a parameter's data type is not an integer or real number, then add single quotes around it. If the database does not do Commits automatically, then add the optional postUpdate node after the insert and update nodes to force the commit. The postUpdate node typically follows this example:

<postUpdate>COMMIT</postUpdate>

A write back template may resemble this example:

<?xml version="1.0" encoding="utf-8" ?>
<WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
<WebMessageTable lang="en-us" system="WriteBack" table="Messages">

   <WebMessage name="SetQuotaUseID">
      <XML>
         <writeBack connectionPool="Supplier">
            <insert>INSERT INTO regiontypequota VALUES(@{c0},@{c1},'@{c2}','@{c3}',@{c4})</insert>
            <update>UPDATE regiontypequota SET Dollars=@{c4} WHERE YR=@{c0} AND Quarter=@{c1} AND Region='@{c2}' AND ItemType='@{c3}'</update>
         </writeBack>
      </XML>
   </WebMessage>

   <WebMessage name="SetQuota">
      <XML>
         <writeBack connectionPool="Supplier">
            <insert>INSERT INTO regiontypequota VALUES(@1,@2,'@3','@4',@5)</insert>
            <update>UPDATE regiontypequota SET Dollars=@5 WHERE YR=@1 AND Quarter=@2 AND Region='@3' AND ItemType='@4'</update>
         </writeBack>
      </XML>
   </WebMessage>

</WebMessageTable>
</WebMessageTables>

Siebel Analytics Web Administration Guide