cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding JDBC Reaciver Adapter

Former Member
0 Kudos

Hi Everyone,

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

The above statement says us Key1 --> is the Primarykey field in Oracle structure. Can some help me in these.

Regd's

Raj

Accepted Solutions (0)

Answers (4)

Answers (4)

bhavesh_kantilal
Active Contributor
0 Kudos

Raj,

UPDATE dbTableName SET col1=’val1’, col2=’val2new’ WHERE ((col2=’val2old’ AND col4=’val4’) OR (col2=’val2old2’))

<KEY> acts as the WHERE for the UPDATE statement . In our case, we have 2 conditions with an OR .

<i>Column values within a <key> element are combined with a logical AND; different <key>elements are combined with a logical OR.</i>

Hope it clarifies.

Regards,

Bhavesh

Former Member
0 Kudos

StatementName1>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”> Here we assing constant for action Tag

<table>realDbTableName</table>: Here we will mention Tname

<access>

<col1>val1</col1> Here is First Field

<col2>val2new</col2> Here is Second Field

</access>

<key1> what is the Purpose do i need to mention Key1 when i am updating only Col1 value and col2 val2

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2> :what is these Key2 i am getting Confuseing here.

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

bhavesh_kantilal
Active Contributor
0 Kudos

Raj,

Are you UPDATING or INSERTING data into the Database?

If you are going to Update the coilumn of the Database, then YOU NEED A WHERE CLAUSE to mention which rows of the DB are to be UPDATED.

The KEY perfroms the role of the WHERE clause of the UPDATE statement.

If you do not want to Update but insert, KEY is not needed and this is how it will be,

StatementName1>

<dbTableName action="<b>INSERT</b>”> <table>realDbTableName</table>

<access>

<col1>val1</col1> Here is First Field

<col2>val2new</col2> Here is Second Field

</access>

</dbTableName>

</StatementName1>

Regards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

yes i am updateing what ever the Col values i need to mention in access same col values need to mention under key.If i am wrong here please correct me.

Regd's

Raj

bhavesh_kantilal
Active Contributor
0 Kudos

Raj,

You are correct

Regards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

Here why should we need to mention more than 1 time a key can you please clarify me in these.

Red's

Raj

bhavesh_kantilal
Active Contributor
0 Kudos

Raj,

Please READ the previous replies.

Multiple KEY is used to group AND cluse.

The column between <key1> </key1> are joined by OR clause and <key1> and <key2> are joined by an AND clause.

Regards,

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

UPDATE dbTableName SET col1=’val1’, col2=’val2new’ WHERE ((col2=’val2old’ AND col4=’val4’) OR (col2=’val2old2’))

This query is what this strcutre will create.. will clarify your doubts.

REgards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

Can you please explain me what is the Reasion do i need to mention Key.while i am write a procedure update.

thanks

Raj

Former Member
0 Kudos

Raj,

Its meaning is:

The name of the <key> element is arbitrary. Column values within a <key> element are combined with a logical AND; different <key>elements are combined with a logical OR. Go through this url which gives explanation with an example:

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

---Satish

deviprasad_pothireddy
Active Participant
0 Kudos

Hi Raj,

Check this weblog

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

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