miércoles, 6 de junio de 2012

package - 06-06-2012


create or replace package pkg_uno is
function CUENTAEMPLEADOS (pDepto IN employees.department_id%type) return number;
end pkg_uno;

create or replace package body pkg_uno is
 FUNCTION CUENTAEMPLEADOS (pDepto IN employees.department_id%type)

 RETURN NUMBER AS
totalEmpleados integer;
BEGIN
  select count(*) into totalEmpleados
  from Employees
  where department_id = pDepto;
  RETURN totalEmpleados;
END CUENTAEMPLEADOS;
end pkg_uno;



    select pkg_uno.CUENTAEMPLEADOS(90) from dual;

No hay comentarios:

Publicar un comentario