Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Which environment variables are absolutely critical in order to run the OUI?

2080


What is oracle host variable?

993


What happens if variable names collide with table/column names?

1117


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1862


What is the implicit cursor in oracle?

1044


Difference between cartesian join and cross join?

974


How to retrieve the count of updated rows?

1066


What is a data dictionary and how can it be created?

1072


What is max rowid in oracle?

974


How to save query output to a local file?

979


what is difference between sql plus and sql*plus? (not sql and sql plus).

3835


How data locks are respected in oracle?

1018


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

990


How to create a new user account in oracle?

964


How to see free space of each tablespace?

981