Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OWB - Difference between INSERT/UPDATE and UPDATE/INSERT ????????

Status
Not open for further replies.

Kioutie

Programmer
Jul 11, 2003
11
CA
Hi,

Can somebody tell me what is the difference between INSERT/UPDATE and UPDATE/INSERT ?

Another question: why, when i do an update/insert or insert/update, OWB give me an error 'constraint key violated' when a row in the target table needs to be update 2 times or more? (2 rows with the key in the source table, which dont have a key). Do you know a tip for this problem?

Thank you !
 
Hi,
For the first question : the diffrence between the 2 methods is the priority
- INSERT/UPDATE tries to insert the record in the table, if it fails because of key violation, it will update the existing record ;
- UPDATE/INSERT tries to update the record relevant to that key, if no record is found, it inserts a new record.
For the second question : are you
sure both methods generate key violation exception ? UPDATE/INSERT should'nt.
Hope this helps
 
check you where clause you must have mentioned where clause more than the primary key fields that is why the update/insert fails.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top