Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Table Has C1 And C2 Column If Exits any record in c1 then
Update c2 record Otherwise insert new record in the C1 And
C2 (Using Procedure)

Answer Posted / ron

use oracle's new feature called upsert :

merge t1
using (select * t1) t2
on (t1.col1=t2.col1)
when matched then
update set col2='value'
when not matched then
insert into (col1, col2) values ('val1', 'val2');

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an Oracle index?

1613


20. Using a set operator, display the client number of all clients who have never placed an order.

2150


Is oracle an open source?

1033


How can you use check constraints for self referential integrity?

929


what are steps for interface? where is exchange rate defined in which table?

2076


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

2217


What is difference between sid and service name in oracle?

914


WHAT IS ecc 6.0

2112


How to convert csv to table in oracle?

936


Is there a function to split a string in plsql?

999


Explain the difference between a procedure and a function? What do you understand by those terms?

1034


How to specify default values in insert statement using oracle?

1060


How to write date and time literals in oracle?

963


What is a sub query and what are the different types of subqueries?

1084


How can we delete duplicate rows in a table?

942