cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC document format

Jitendra_Jeswan
Contributor
0 Kudos

Hi folks,

I m using JDBC adapter at the Receiver side, and i m using "XML SQL Format" as message protocol.

the document format looks like ;

<root>

<StatementName1>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

</root>

My question is can't we have multiple <dbtableName> have same action but different values in <table>tag assuming i have three tables to perform UPDATE_INSERT on say like below...and map data from the Same Source message.

<root>

<StatementName1>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName1</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName><dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName2</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName3</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

</root>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, You can have . In that case you will have the table structures with different actions and different table names..same like your first one.

/Raj.

Answers (5)

Answers (5)

Jitendra_Jeswan
Contributor
0 Kudos

hi naveen. It worked for me.

If you have any other queries.

you can ask me.

-Jeet.

Former Member
0 Kudos

Hi Jeet,

Did the last post of this thread work for u. I am also trying sth like this.

Please tell me if u have tried anything else.

-Naveen.

bhavesh_kantilal
Active Contributor
0 Kudos

Naveen,

It wil work. GO ahead and do it.

Regards,

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

jeet,

create a datatype of this format,

<root>

<b><statementname1> 1..1</b>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

<b><statementname2> 1..1</b>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName</table>

<access>

<cola>val1</col1>

<colb>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName2>

</root>

create statementname of different names and of the format needed by your table , and it will work fine.

regards,

bhavesh

Former Member
0 Kudos

HI Jeet,

You can definetly update multiple tables using only one call.

The only change in your message format is that it should multiple Statement tags. Updating different tables in sql will correspond to different statements.

example.

<root>

<StatementName1>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table></table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<key1>

<col2>val2</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

<StatementName2>

<dbTableName action=”INSERT”>

<table>realDbTableName2</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName2>

Please refer the following link for more detail.

http://help.sap.com/saphelp_nw2004s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm

Regards,

Yomesh

bhavesh_kantilal
Active Contributor
0 Kudos

hi jeet,

I have tried this by changing the occurence of STATEMENT to 0 to UB and keeping the rest as is. This way, I mapped my real Table name to the table name tag and made multiple entries in different tables, but of the same strucure.

Is this what you are tring too. If all tables have the same strucute then you can acheieve this using the single datatype by changing the occurence of the STATEMENT to 0 to UB.

But , if they are all tables of different formats, then i think you need to go for different datatypes with multi mapping.

I have not tried the option of changing the occurence of the DBTABLE NAME, but i think it should also work.

DO try and let us know.

Regards,

Bhavesh

Message was edited by: Bhavesh Kantilal

Message was edited by: Bhavesh Kantilal

Jitendra_Jeswan
Contributor
0 Kudos

hi all again, thanks for this speedy response.

i have completely defferent Structures for diff. tables, and the Source message is only one.

What i need is i want to map the Source message to one Document format at the JDBC side, i m wondering wether i can have Only one Document format and multiple Segments having multiiple "action" attribute and "table" tag. so that i can have same action but different table names in the multiple "table" tag, and do the mapping (data updated/inserted) in Database in one GO.