Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP table high;
- DROP table medium;
- DROP table low;
- create table high
- ( id number(10) not null,
- salary varchar2(50) not null
- );
- describe high;
- create table medium
- ( id number(10) not null,
- salary varchar2(50) not null
- );
- describe medium;
- create table low
- ( id number(10) not null,
- salary varchar2(50) not null
- );
- describe low;
- create or replace procedure sal
- (p_id in employees.employee_id%type,
- p_salary out employees.salary%type) is begin
- select salary into p_salary from employees where employee_id=p_id;
- end sal;
- /
- declare
- emp_id employees.employee_id%type;
- v_salary employees.salary%type;
- begin
- emp_id:=&employee_id;
- sal(emp_id,v_salary);
- if v_salary>9000
- then
- insert into high (id,salary) values (emp_id, v_salary);
- elsif v_salary<6000
- then
- insert into low (id,salary) values (emp_id, v_salary);
- else
- insert into medium (id,salary) values (emp_id, v_salary);
- end if;
- end;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement