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
What are the ways tablespaces can be managed and how do they differ?
How to convert characters to dates in oracle?
i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?
How to view the data files in the current database?
How do we get field details of a table?
How can windows applications connect to oracle servers?
How to pass parameters to procedures in oracle?
How to delete a column in an existing table in oracle?
How to compare dates in oracle sql?
How to create a new oracle data file?
What is data file?
How to put more than 1000 values into an oracle in clause?
What privilege is needed for a user to create views in oracle?
What is object data modeling?
How to pass parameters to procedures?