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
How a tablespace is related to data files?
How to create a table in a specific tablespace?
What is transport network substrate (tns) in oracle?
How to convert dates to characters in oracle?
How to delete a column in an existing table?
What is an oracle recycle bin?
What is the exact use of Collections?
Does oracle database need java?
What is connection pool in oracle?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
How to use "while" statements in oracle?
How many types of synonyms in Oracle?
How to select some rows from a table in oracle?
What is a initialization parameter file in oracle?
How can I see all tables in oracle?