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

Explain an integrity constrains?

703


Explain the use of rows option in imp command.

604


How to define an external table with a text file?

579


What is system tablespace?

634


Explain what are the uses of rollback segment?

589






How to use "in out" parameter properly?

619


How to view existing locks on the database?

553


Respected sir, Please send me technical questions related to oracle apps..

1382


How to run the anonymous block again?

596


Why do we need oracle client?

511


How many types of tables are there in oracle?

577


How to build data dictionary view an new database?

532


List out the components of logical database structure of oracle database.

585


What is the relationship among database, tablespace and data file?

545


How to update a table row with a record?

597