Thursday, February 14, 2013

OBIEE 11g - Writeback Steps

Follow the steps listed below to configure Write Back 

Step1: Enable Write Back. Add the tag below any where in between  the serverinstance tag of instanceconfig.xml 

<ServerInstance>
<LightWriteback>true</LightWriteback>
</ServerInstance>

Restart OBIPS for this change to be effective. 

Step2: Add WriteBack privileges to the user/Group/Role.

Step3:WriteBack Template.

Things to do before you start the Template:

Identify the colums that are to be referenced. we can use the colum position or by colum id as you see them in the XML definition.
We must include both insert and update stmts in the template.
Make sure we document the template name so that we may not conflict with any other.
Also it is the best practise to include the commit statement( <postUpdate>COMMIT</postUpdate> ).
Template to be placed in the path:
$ORACLE_INSTANCE/bifoundation/OracleBIPresentationServicesComponent/coreapplication_obipsn/analyticsRes/customMessages

Given below is the writeback template for 5 Colums.

Write-Back Template 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>