cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping - JDBC Scenario

Former Member
0 Kudos

Hi friends

Scenario:

File-->PI--->Database ( jdbc)

In the above scenario while designing the mapping :

We are using TableName , Access , Key nodes

Under Access node : I have all the fields

I am not sure whether to use andy fields under Key node

Kindly guide me what is signifance of Key and whether i need to use this key node.

My Requreiment :

If there are multiple entries for same product id with <PurchaseMode>New Contract</PurchaseMode> value, then overwrite value in DB with the last product idu2019s value

Hoe to achieve the above requreiemnt ?

Renu

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187339
Active Contributor
0 Kudos

Hi Renu,

>>If there are multiple entries for same product id with <PurchaseMode>New Contract</PurchaseMode> value, then overwrite value in DB with the last product idu2019s value

I guess you cannot do this using a single Query in Database. Right? So you may need to have a Stored Procedure in receiver side.

Check this link for your futher query on Key, Access etc.

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Regards

Suraj

Former Member
0 Kudos

I am new to JDBC scenarios.

I am sending the target side xsd for your refence.

Kindly let me know what i need to do

 <?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ProdCatalog_Simplexity xmlns:ns0="http://palm.com/PALMPRODCATALOG/Simplexity"><STATEMENT_STORE_SIMPLEXITY_FEED><TABLENAME ACTION="UPDATE_INSERT"><TABLE>STORE_SIMPLEXITY_FEED</TABLE><ACCESS><CARRIER_DESC>AT&amp;T</CARRIER_DESC><MANUFACTURER_NAME>AT&amp;T</MANUFACTURER_NAME><Manufacturer_Code>Quickfire Orange</Manufacturer_Code><PRODUCTID>58882</PRODUCTID><EQUIPMENT_NAME>ATT Quickfire Orange</EQUIPMENT_NAME><EQUIPMENT_TYPE>Phone</EQUIPMENT_TYPE><EQUIPMENT_SHORT_DESC> </EQUIPMENT_SHORT_DESC><EQUIPMENT_LONG_DESC>ATT Quickfire Orange</EQUIPMENT_LONG_DESC><SUG_RETAIL_PRICE>349.9900</SUG_RETAIL_PRICE><DISPLAY_PRICE>$999.99</DISPLAY_PRICE><EQUIPMENT_PRICE>0</EQUIPMENT_PRICE><NUMERIC_COST>0</NUMERIC_COST><REBATE_AMOUNT>$0.00</REBATE_AMOUNT><PRICE_AFTER_REBATE>Free</PRICE_AFTER_REBATE><REBATE_DESC>0.00 Unknown&lt;br&gt;0.00 Unknown</REBATE_DESC><EQUIPMENT_IMAGEFILE_SMALL>images/phones/57631_s.jpg</EQUIPMENT_IMAGEFILE_SMALL><EQUIPMENT_IMAGEFILE_MEDIUM>images/phones/57631_m.jpg</EQUIPMENT_IMAGEFILE_MEDIUM><EQUIPMENT_IMAGEFILE_LARGE>images/phones/57631_l.jpg</EQUIPMENT_IMAGEFILE_LARGE><MANUFACTURER_LOGO>_images/logos/manufacturers/selected_manu_att.gif</MANUFACTURER_LOGO><PURCHASE_MODE>New Contract</PURCHASE_MODE><PRODUCT_LINK>r.aspx?p=ATT%20Quickfire%20Orange&amp;c=AT%26T&amp;r=bbgadgets&amp;mode=1</PRODUCT_LINK><UPC>044476807978</UPC><COMPATIBLE_ACCESSORIES_PAGEURL>DeviceSpecificAccessories.aspx?referringdomain=bbgadgets&amp;refcode1=standarddatafeed&amp;refcode2=&amp;productid=57631</COMPATIBLE_ACCESSORIES_PAGEURL><IS_BELOW_IMAP>false</IS_BELOW_IMAP></ACCESS></TABLENAME></STATEMENT_STORE_SIMPLEXITY_FEED><STATEMENT_STORE_FEED_REFRESH_DATE><TABLENAME ACTION="UPDATE"><TABLE>STORE_FEED_REFRESH_DATE</TABLE><ACCESS><REFRESH_FEED>YES</REFRESH_FEED><REFRESH_CACHE>YES</REFRESH_CACHE><EXTRACT_DATE>2010/10/08</EXTRACT_DATE><FEED_TYPE>SFeed</FEED_TYPE></ACCESS></TABLENAME></STATEMENT_STORE_FEED_REFRESH_DATE></ns0:MT_ProdCatalog_Simplexity>

stefan_grube
Active Contributor
0 Kudos

> I am new to JDBC scenarios.

Read online help, everything is mentioned what you need to know.

Look out for SDN weblogs for this topic.

former_member208856
Active Contributor
0 Kudos

When we are using JDBC as Receiver System

using Action INSERT, UPDATE & INSERT_UPDATE

We need to use KEY only for UPDATE, as we will update a record which is exists in Table.

we will pass the value of that KEY, so that we can pick that first from table & update the same.

In the case of INSERT_UPDATE, we will pass the value for UPDATE Action, for INSERT Action KEY value will be blank.

stefan_grube
Active Contributor
0 Kudos

> Kindly guide me what is signifance of Key and whether i need to use this key node.

When you look in online help, this is explained very clearly.

You need key for update so that DB knows which row you want to update.

The key can be generic.

> If there are multiple entries for same product id with <PurchaseMode>New Contract</PurchaseMode> value, then overwrite value in DB with the last product idu2019s value

When you use PurchaseMode as key, then all entries with same PurchaseMode are updated at once.

Former Member
0 Kudos

Hi Stefan,

It means i need to add the following fields : Product id & Purchase mode under key node and do one to one mapping