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 are set operators?
What do you mean by a deadlock?
How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
Does oracle partitioning improve performance?
How do I use unicode codesets with the weblogic jdriver for oracle driver?
What are the data types in oracle?
Explain the use of grant option in exp command.
Is primary key indexed by default in oracle?
How to load data through external tables?
What is the use of aggregate functions in oracle?
How to start an oracle instance?
How to create a testing table in oracle?
Explain what are the different type of segments?
What is where clause in oracle?
Can you have more than one content canvas view attached with a window ?