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

How to start your 10g xe server?

682


What is an oracle table?

639


Is it possible to split the print reviewer into more than one region ?

1917


What privilege is needed for a user to create views in oracle?

680


Can we protect our pl/sql source code?

661






What is connection pooling in oracle?

633


What is open database communication (odbc) in oracle?

623


What is the difference between $oracle_base and $oracle_home?

685


What is an index associated with a constraint?

642


What is not equal to in oracle?

641


What is save point in oracle database?

835


How to load excel data sheet to oracle database

660


How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?

2832


Explain what are the uses of rollback segment?

660


Explain oracle insert into command?

720