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


Please Help Members By Posting Answers For Below Questions

IS it possible to built the oracle database without setting the kernal parameters?

1763


Write a trigger example in oracle?

573


What happens in oracle commit?

572


How oracle handles dead locks?

602


List out the difference between commit, rollback, and savepoint?

621






ABOUT IDENTITY?

1563


What is a read write transaction in oracle?

606


what is difference between sql plus and sql*plus? (not sql and sql plus).

3349


How to use like conditions in oracle?

569


What is a snapshot in oracle database?

581


Explain the use of record option in exp command.

537


Can u please explain me the Discussion on Except ,using cast like type cast. Question in the context of difference between two tables

1583


Explain the truncate in oracle?

549


What is an oracle user account?

582


What is a view and how is it different from a table?

574