cancel
Showing results for 
Search instead for 
Did you mean: 

How to update data in the database

Former Member
0 Kudos

Hi,

i m doing file to jdbc scenario

can anyone tell me how to update data in the database

can u give me the mapping for the same or some link

plz reply soon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can update the database by using jdbc adapter ....

Go through this links and blogs u will find out how to update the data base...

/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes

/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30

/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn file to jdbc

JDBC ADAPTER

http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm

/people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter

/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC

JDBC - http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

multiple tables with JDBC - http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

JDBC Response /people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous

JDBC RECEIVER ADAPTER

/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

plz reward points

thanq

Answers (5)

Answers (5)

Former Member
0 Kudos

thnks a tonn

Former Member
0 Kudos

Hi,

Create yor outbound message type according to your table structure(create action attribute at the begining of the inbound structure and then add your table strucre). in your message mapping, map a constant with value "INERT" or "UPDATE". User JDBC adapter in your inbound CC.

Thanks,

Reyaz

Former Member
0 Kudos

Hi,

To update the database table you need to have use receiver JDBC adapter with either UPDATE or INSERT_UPDATE actions

UPDATE will update the table and INSERT_UPDATE will either insert the data if its not available or update if the data available as per key fields given in below structure.

Remember to have same field names (col1) as per database table. (Case sensitive)

Please follow below structure while creating Receiver Data type and for mapping

<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>

http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm

Here you have to pass the key filed values and the data to be updated in

database table.

then you just need to configure the Receiver JDBC adapter,

I think there are couple of links have already provided, so you could refer from it for step by step procedure

Please let me know if you need any thing else in it

thanks

Swarup.

Former Member
0 Kudos

Hi,

the structure which u gave is wht i have made but thing is tht i have

an input file with many records.now at runtime for a particular value of a column update should be taken so how to do tht?.

wht should i give in the column which is there under the key node

Former Member
0 Kudos

Hi Vikas,

As you had said there are many records in the file.

So you have the file structure with you as well as the table strructure.

Lets say file structure is

<Head>

-->Field1

-->Field2

-->Field3

-->Field4

-->Field5

Table structrue is

TableName

-->col1

-->col2

-->col3

-->col4

Here you could get the info as which are the key fields in table lets say col1 is key field.

Now in mapping you will have to update only col2 and col4 so the structure will be as below

<root>

<StatementName1>

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

<table>TableName</table>

<col2>val1</col2>

<col4>val2new</col4>

<key1>

<col1>val1old</col1>

</key1>

</TableName>

</StatementName1>

</root>

Here you just need to map the

file to JDBC

Field1 ---> Col1

Field2 ---> Col2

Filed4 ---> Col4

remeaining Fields from flat file will be there but no mapping have to do for it.

thus on the basis of Field1 we will be updating Field 2 and Field4.

The important thing while dealing with Multiple records is in fiel structure

the HEAD will be with Occurance unbounded (Can do this at Data type)

and on JDBC structure side it will be StatementName with Occurance unbounded .

Here you will get Step by Step Screen Shots of File to JDBC as what I had explained you above

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a04cd6f9-9eb0-2a10-07b8-a0fc6e88...

Thanks

Swarup

Edited by: Swarup Sawant on Feb 14, 2008 10:27 AM

Former Member
0 Kudos

Hi,,

You can map UPDATE keyword using constant function to action an attribute...

Former Member
0 Kudos

Hi vikas,

Just give the table corresponding in table filed and in action use UPDATE_INSERT

Regards...