create or replace procedure salary_pro (id_p IN varchar2 ,sal_p IN OUT varchar2 ) IS
temp_salary varchar2(10);
BEGIN
SELECT salary INTO temp_salary
FROM salary_table WHERE emp_id = id_p;
IF temp_salary between 1000 and 10000 THEN
sal_p := temp_salary+1000;
--dbms_output.put_line(sal_p);
ELSIF
temp_salary>10000 THEN
sal_p:=temp_salary+2000;
--dbms_output.put_line(sal_p);
END IF;
END;
-----------------
declare
v_sal varchar2(10);
begin
salary_pro(1,v_sal);
dbms_output.put_line( v_sal);
end;
temp_salary varchar2(10);
BEGIN
SELECT salary INTO temp_salary
FROM salary_table WHERE emp_id = id_p;
IF temp_salary between 1000 and 10000 THEN
sal_p := temp_salary+1000;
--dbms_output.put_line(sal_p);
ELSIF
temp_salary>10000 THEN
sal_p:=temp_salary+2000;
--dbms_output.put_line(sal_p);
END IF;
END;
-----------------
declare
v_sal varchar2(10);
begin
salary_pro(1,v_sal);
dbms_output.put_line( v_sal);
end;
No comments:
Post a Comment