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

How to create tables for odbc connection testing?

1081


How to estimate disk space needed for an export job?

1028


What is oracle thin client?

1008


What is meant by raw datatype?

1043


How to write an inner join with the where clause in oracle?

1029


Explain oracle insert into command?

1083


What is logical backup in oracle?

997


How to retrieve the count of updated rows?

1106


How to work with data objects interactively?

957


How to sort output in descending order in oracle?

1023


What is the implicit cursor in oracle?

1080


What is a trigger and what are its types in oracle?

1049


Explain oracle instance.

1154


What are the various oracle database objects?

1125


What is truncate oracle?

957