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 do we get field detail of a table?
How to change system global area (sga) in oracle?
What is oracle used for?
What are the varoius components of physical database structure of oracle database?
What are the database administrators utilities available?
How to start an oracle instance?
Describe the types of sub query?
Why do I get unexpected characters from 8-bit character sets in weblogic jdriver for oracle?
Can select statements be used on views in oracle?
Explain the use of show option in imp command.
How to use values from other tables in update statements using oracle?
How does oracle handle read consistency?
What are the data types in oracle?
What is where clause in oracle?
How to create a new tablespace in oracle?