Write a PL/SQL block to select the name of the employee with a given salary value. You will be using the MESSAGES table that was created for a previous assignment.
Declare a variable of type emp.sal as a salary variable and assign the value 800 to that variable.
If the salary entered returns more than one row, handle the exception with an appropriate exception handler and insert into the MESSAGES table the message "More than one employee with a salary of ."
If the salary entered does not return any rows, handle the exception with an appropriate exception handler and insert into the MESSAGES table the message "No employee with a salary of ."
If the salary entered returns only one row, insert into the MESSAGES table the employee's name and the salary amount.
Handle any other exception with an appropriate exception handler and insert into the MESSAGES table the message "Some other error occurred."
Before you run your SQL run the following SQL statement:
delete from messages;
Observe the output similar to the following results:
9 row(s) deleted.