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

Explain the dml?

1041


What is Java Pool in Oracle?

1234


Why we use bulk collect in oracle?

1111


Can a formula column be obtained through a select statement ?

2378


How to find the duplicate rows count from employees table in oracle?

1143


What is the difference between pre-select and pre-query?

1295


What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

4567


How to assign values to variables?

1163


How to do paging with oracle?

1049


How to define and use table alias names in oracle?

986


What is the usage of control file in oracle?

1141


Can we connect to ORACLE db using Windows Authentication?

1305


Explain what are the uses of rollback segment?

1064


How to estimate disk space needed for an export job?

1103


Please explain oracle left join with an example?

1089