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" ?>
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.
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?