I want to create a procedure that deletes the employee with the greatest salary. I have this code:
create or replace procedure DelMostExpensive
as
begin
delete from hr.Employees where
hr.Employees.EmpName=
(select EmpName from hr.Employees where
salary = (select max(salary) from hr.Employees))
and hr.Employees.birthDate=
(select birthDate from hr.Employees where
salary = (select max(salary) from hr.Employees));
end;
But I get these errors: Error(4,1): PL/SQL: SQL statement ignored. Error(4,16): PL/SQL: Ora-00942 table or view does not exist. How to make it work?