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

Is there a combination of "like" and "in" in sql?

1065


Does oracle partitioning improve performance?

995


how to clone 9i Database on to 10g Database.

2340


Is there an oracle sql query that aggregates multiple rows into one row?

983


Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?

1020


How to find out what oracle odbc drivers are installed?

1042


How does Oracle guarantee data integrity of data changes?

2390


What is raw datatype?

1137


What are the types of trigger in oracle?

984


What is a system tablespace and when it is created?

972


In not less than 100 words what's the main difference between Rolap and Molap in ORACLE ?

2287


Explain the use of online redo log files in oracle.

1038


In Oracle Clinical 4.5.0, can the VIEW_TEMPLATE_ID column in DATA_EXTRACT_VIEWS table contain NULL value?

2341


How to define an anonymous block?

1158


What is the maximum number of triggers that can be applied to a single table?

1027