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
Explain the dml?
What is Java Pool in Oracle?
Why we use bulk collect in oracle?
Can a formula column be obtained through a select statement ?
How to find the duplicate rows count from employees table in oracle?
What is the difference between pre-select and pre-query?
What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
How to assign values to variables?
How to do paging with oracle?
How to define and use table alias names in oracle?
What is the usage of control file in oracle?
Can we connect to ORACLE db using Windows Authentication?
Explain what are the uses of rollback segment?
How to estimate disk space needed for an export job?
Please explain oracle left join with an example?