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 / ramprasad.s

Hi Answer to Your question
IS
create or replace procedure samp(cname IN sample.ename%type,
cno IN sample.eno%type)
AS
ccount number;
begin
select count(*) INTO ccount from sample;
IF ccount = 0 then
update sample set ename = cname;
else
insert into sample values(cname, cno);
END IF;
END;


Sample Table is
ENAME ENO
100

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of modules in oracle forms?

772


What are the set operators union, union all, minus & intersect meant to do?

783


How would you go about verifying the network name that the local_listener is currently using?

1837


How do you get nicely formatted results from an oracle procedure that returns a reference cursor?

839


Describe varray?

858


How view is different from a table?

820


What is where clause in oracle?

789


What is a synonym? What are its various types?

894


What is oracle database 10g express edition?

846


How to store only time; not date and time?

767


Difference between hot backup vs. Cold backup?

806


Explain about functional dependency and its relation with table design?

802


What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.

902


How to bring a tablespace online?

763


what is normalisation?what are its uses?

1976