Hello Experts ;
Good morning all;
i am trying to execute a program using procedure ( IN and IN OUT ) parameter.
i have a emp table i want to update perk column details.
>> Here is coding >>
1 create or replace procedure emp_salary
2 (id IN emp.eid%type , salary IN OUT emp.esalary%type) IS
3 tmp_sal number;
4 BEGIN
5 select esalary into tmp_sal from emp where eid=id;
6 if tmp_sal between 10000 and 20000 THEN
7 salary_inout := tmp_sal*1.2;
8 else if tmp_sal between 20001 and 29999 THEN
9 salary_inout := tmp_sal*1.8;
10 ELS IF tmp_sal > 30000 then
11 salary_inout := tmp_sal*2.0;
12* END;
SQL> /
Warning: Procedure created with compilation errors.
SQL> show errors;
Errors for PROCEDURE EMP_SALARY:
LINE/COL ERROR
-------- -----------------------------------------------------------------
10/5 PLS-00103: Encountered the symbol "IF" when expecting one of the
following: := . ( @ % ; The symbol ";" was substituted for "IF" to continue.
12/4 PLS-00103: Encountered the symbol ";" when expecting one of the
following: if
MY DB version is : 10.2.0.1
emp details :
SQL> select * from emp;
|EID | ENAME | EQUAL | ESALARY | ECITY | EPERK |
1 sona | mba | 10000 | ******** | |
2 maya | mca | 15000 | **********| |
3 sony | msc | 20000 | **** | |
4 King | m.s | 22000 | **********| |
5 ford | m.s | 40000 | **********| |
Thanks in advance ;