create or replace procedure set_update(p_name in varchar2,p_email in varchar2)
is
l_data user_details%rowtype;
begin
select * into l_data
from user_details ud
where ud.name = p_name
and ud.email = p_email;
if l_data.name = p_name and l_data.email = p_email then
update user_details
set last_login_date = sysdate , date_updated = sysdate
where name = p_name and email=p_email;
end if;
exception
when no_data_found then
insert into user_details(user_id,name,last_login_date,date_updated,date_created,email)
values (l_data.user_id,p_name,l_data.last_login_date,l_data.date_updated,sysdate,p_email);
end set_update;
This is my procedure will pass two parameters if it is available in table it will update other wise insert that data in table.
My problem is while data is not available that data is inserted into table but that not inserted into table.
Can any one help for that problem
My thanks in advance for all your help.