Я создал следующую процедуру:
create or replace function getDepartmentById(name varchar2)
return number
is v_dep number(10)
begin
--the sql statement is totally fine
select deptno into v_dep from dept where dname = name;
end;
/
, но когда я звоню
select getDepartmentById('SALES') into dep from dual;
, я получаю это сообщение об ошибке
Error report -
ORA-06550: line 20, column 14:
PL/SQL: ORA-06575: Package or function GETDEPARTMENTBYID is in an invalid state
ORA-06550: line 20, column 7:
PL/SQL: SQL Statement ignored