You are on page 1of 1

create or replace

function MOSTRAR_EMPLEADO_PAIS (CODIGO EMPLOYEES.EMPLOYEE_ID%TYPE )


RETURN VARCHAR2
AS
NOMBRES EMPLOYEES.FIRST_NAME%TYPE;
APELLIDO EMPLOYEES.LAST_NAME%TYPE;
PAISES COUNTRIES.COUNTRY_NAME%TYPE;

BEGIN
select e.first_name, e.last_name , co.country_name INTO NOMBRES,APELLIDO,PAISES
from employees e
inner join departments d on e.department_id= d.department_id
inner join locations l on d.location_id= l.location_id
inner join countries co on l.country_id= co.country_id
WHERE e.employee_id=CODIGO;

RETURN NOMBRES;
END;

BEGIN
DBMS_OUTPUT.PUT_LINE( MOSTRAR_EMPLEADO_PAIS(198));
END;

You might also like