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

When do I need to use a semicolon vs a slash in oracle sql?

674


Explain oracle instance.

758


What are the extensions used by oracle reports?

653


What is the difference between online and offline backups?

637


Why use resource manager in Oracle?

744






How to convert times to characters in oracle?

685


while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511

3997


How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

1548


What is transaction control statement and how many types of transaction control statement in Oracle?

656


How to use group functions in the select clause using oracle?

673


Does oracle database need java?

602


What is a trigger and what are its types?

687


What is Java Pool in Oracle?

702


How to select some columns from a table in oracle?

624


Can you have more than one content canvas view attached with a window ?

1899