您必须将其分解为包规范和包体。
所以
create or replace package PKG_EMPLOYES as
function PRENOM_EMP (nom in EMPLOYEES.LAST_NAME%type)
return EMPLOYEES.FIRST_NAME%type;
end PKG_EMPLOYES;
/
和主体:
create or replace package body PKG_EMPLOYES as
function PRENOM_EMP (nom in EMPLOYEES.LAST_NAME%type)
return EMPLOYEES.FIRST_NAME%type IS
prenom EMPLOYEES.FIRST_NAME%type;
begin
select FIRST_NAME
into prenom
FROM EMPLOYEES
WHERE last_name = nom;
return prenom;
EXCEPTION
when too_many_rows then
return ('l ordre sql ramene plus d une ligne');
end PRENOM_EMP;
end PKG_EMPLOYES;
/