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
What is an Oracle index?
20. Using a set operator, display the client number of all clients who have never placed an order.
Is oracle an open source?
How can you use check constraints for self referential integrity?
what are steps for interface? where is exchange rate defined in which table?
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?
What is difference between sid and service name in oracle?
WHAT IS ecc 6.0
How to convert csv to table in oracle?
Is there a function to split a string in plsql?
Explain the difference between a procedure and a function? What do you understand by those terms?
How to specify default values in insert statement using oracle?
How to write date and time literals in oracle?
What is a sub query and what are the different types of subqueries?
How can we delete duplicate rows in a table?