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

What are set operators?

846


What do you mean by a deadlock?

776


How do you get nicely formatted results from an oracle procedure that returns a reference cursor?

830


Does oracle partitioning improve performance?

768


How do I use unicode codesets with the weblogic jdriver for oracle driver?

806


What are the data types in oracle?

794


Explain the use of grant option in exp command.

782


Is primary key indexed by default in oracle?

754


How to load data through external tables?

884


What is the use of aggregate functions in oracle?

816


How to start an oracle instance?

796


How to create a testing table in oracle?

775


Explain what are the different type of segments?

763


What is where clause in oracle?

784


Can you have more than one content canvas view attached with a window ?

2072