on 08-23-2006 4:51 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.