|
|
|
@ -5,7 +5,7 @@ FUNCTION hire
|
|
|
|
|
(last_name VARCHAR2, job_id VARCHAR2, |
|
|
|
|
manager_id NUMBER, salary NUMBER, |
|
|
|
|
commission_pct NUMBER, department_id NUMBER) |
|
|
|
|
RETURN NUMBER IS new_empno NUMBER; |
|
|
|
|
RETURN NUMBER IS new_empno NUMBER; |
|
|
|
|
BEGIN |
|
|
|
|
SELECT employees_seq.NEXTVAL |
|
|
|
|
INTO new_empno |
|
|
|
@ -69,5 +69,22 @@ PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER) IS
|
|
|
|
|
SET commission_pct = commission_pct + comm_incr; |
|
|
|
|
END IF; |
|
|
|
|
END; |
|
|
|
|
END emp_mgmt; |
|
|
|
|
END emp_mgmt; |
|
|
|
|
/* |
|
|
|
|
PROCEDURE commented_func(employee_id NUMBER, comm_incr NUMBER) IS |
|
|
|
|
curr_comm NUMBER; |
|
|
|
|
BEGIN |
|
|
|
|
SELECT commission_pct |
|
|
|
|
INTO curr_comm |
|
|
|
|
FROM employees |
|
|
|
|
WHERE employees.employee_id = increase_comm.employee_id; |
|
|
|
|
IF curr_comm IS NULL |
|
|
|
|
THEN RAISE no_comm; |
|
|
|
|
ELSE |
|
|
|
|
UPDATE employees |
|
|
|
|
SET commission_pct = commission_pct + comm_incr; |
|
|
|
|
END IF; |
|
|
|
|
END; |
|
|
|
|
END emp_mgmt; |
|
|
|
|
*/ |
|
|
|
|
/ |