on 03-10-2009 9:08 PM
Hi,
I am have configured an IDoc to JDBC(DB) scenario.Since I need to update two table ,I have create two Statment's as shows in the below XML.
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:PartDetails_Request xmlns:ns0="http://xxx.com/target">
<Statement1>
<dbTableName action="INSERT">
<table>Table1</table>
<Access>
<field1></field1>
<field2></field2>
</Access>
</dbTableName>
</Statement1>
<Statement2>
<dbTableName action="INSERT">
<table>Table2</table>
<Access>
<field1></field1>
<field1></field1>
</Access>
</dbTableName>
</Statement2>
</ns0:PartDetails_Request>
I tried inserting records and its works fine.I mean both the tables(Table1 and Table2) get the record.
But there is problem,
In some scenarios,
In payload ,Table1 has values and Table2 doesn't have any values.I mean Table2 payload is empty,so it generats a empty SQL Query and would try to INSERT the table,which is the error.So the data doesn't get inserted to both tables.
So I thought of some condition like ,only if Table1-field2 has some value, then I should insert a value to Table2 ,ie.only then the SQL Query for Table2 should be created.
else,
If a particular Idoc field has some value only then the SQL for table2 should be created.
So how can I achive this? So how to handel this null values in Table2?
Thanks,
Venu
Hi Venu,
from a logical pouint of view, you have two transactions:
a) insert table #1
b) insert table #2
So, if there is no logical connection between there two table, why don't you set up two mappings with two inserts.
Under restart aspects this has also benefits.
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Venu,
I endorse Mario's view.
the best way for you since the tables are different is to segregate the mappings for the table. So even though you have the same receiver, use different inbound interfaces that means two different interface determinations. Note you can reuse the same JDBC recv. CC
~~ ShaBZ
hi venu
cud u plz provide the idoc structure with occurence & under wht condtions the idoc fields are mapped to fields of both table 1 & table 2.
regards
sabyasachi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.