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 / senthilkumar
create or replace procedure update is
declare
cursor updt is
select cl from table;
num number(4);
begin
open updt;
fetch updt into num;
if num != NULL
then
update table set c2 = num or(desired data);
else
insert into table values(value,value);
exception
when others then
DBMS_OUTPUT.PUT_LINE('SQLERR'|| ''||SQLERRM);
end;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the Tune Query
What are a cluster and non-cluster index?
Explain table?
How to do a full database export?
Can you create a synonym without having a table?
How do we get field detail of a table?
Can we write dml statement in function in oracle?
Which is faster join or subquery in oracle?
How to define a cusotmer as a supplier in ORACLE R12
How to call a stored function in oracle?
What is the quickest way to fetch the data from a table?
How to set up autotrace for a user account?
How many types of auditing in Oracle?
Name the three major set of files on disk that compose a database in Oracle?
Explain the use of owner option in exp command.