Able to add only one entry to database
Hi,
I have created a table and write a procedure with input parameters. I am inserting string as command text through c#. But only updating one record (not first nor last).
Database = Test
create Table Test.Employee (EmpName nvarchar(10), EmpId int, salary numeric(19,4))
delimiter /
create procedure (in EmpName nvarchar(10), in EmpId int, salary numeric(19,4))
begin
if exists( select EmpId from Test.Employee)
then
update Test.Employee EmpName=EmpName, Salary=salary where EmpId=EmpId;
end if;
else
insert into Test.Employee (EmpName, EmpId, Salary) values (EmpName,. EmpId, salary);
end if;
end /
delimiter ;
Help me with this. thanks
Subject
Written By
Posted
Able to add only one entry to database
June 24, 2016 02:54AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.