PL/SQL Employee Management Package Example
Classified in Arts and Humanities
Written on in English with a size of 5.58 KB
PL/SQL Package: gestionEmpleados Specification
CREATE OR REPLACE PACKAGE gestionEmpleados
AS
-- Cursor to get average salary per department
CURSOR curMediaSueldo IS
SELECT AVG(salario) "media", dept_no
FROM emple
GROUP BY dept_no;
-- Cursor to select all employees
CURSOR curEmpleados IS
SELECT *
FROM emple;
-- Cursor to select all departments
CURSOR curDepartamentos IS
SELECT *
FROM depart;
-- Package variables
nombre VARCHAR2(40);
media NUMBER;
departamento VARCHAR2(20);
-- Function declaration to get department name
FUNCTION nomDepart(numeroDpt depart.dept_no%TYPE)
RETURN gestionEmpleados.departamento%TYPE;
END gestionEmpleados;
PL/SQL Package Body: gestionEmpleados
CREATE OR
... Continue reading "PL/SQL Employee Management Package Example" »