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
Is there any way to find out when one specific table/view/M-view is used last time. i.e. when one specific object is used in any SELECT statement.
Whats the benefit of dbms_stats over analyze?
Describe an oracle table?
What is a snapshot in oracle database?
What is an oracle recycle bin?
What is oracle latest version?
various types of hints and their usage
How to open and close an explicit cursor in oracle?
How to get a create statement for an existing table?
Which is better Oracle or MS SQL? Why?
How to pass parameters to procedures?
State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.
Can we create database in oracle using command line ?
Whether any commands are used for months calculation? If so, what are they?
How to convert times to characters in oracle?