Solved

ibatis insert or update?

Posted on 2010-09-10
1
1,127 Views
Last Modified: 2012-05-10
I've been looking for an example how this should be handled but found nothing.
I have some records I want to Insert into a table, but if the PKs for these records already exist, I want iBatis to do an update instead.
How is this usually done with iBatis?
0
Comment
Question by:blackfrancis75
1 Comment
 
LVL 5

Accepted Solution

by:
blackfrancis75 earned 0 total points
ID: 33662619
pull your data into a temp table, then: insert into realtable select * from temp_table where id not in (select id from realtable);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now