Question: PL/SQL is required for the function and procedure, a picture of the empl table is included. Thank you. Write a PL/SQL stored function get_manager that

PL/SQL is required for the function and procedure, a picture of the empl table is included. Thank you.

Write a PL/SQL stored function get_manager that expects the name of an employee and returns the name of that employee's manager -- HOWEVER: if the name given is NOT that of any employee, it should INSTEAD return the string 'Not an employee'. if TWO or more employees have that name, it should return the string 'Name not unique'. if the employee has NO manager, it should return the string 'No manager' instead of NULL. Also write a PL/SQL stored procedure show_manager that expects the name of an employee and prints to the screen the result of calling get_manager in a message that includes the given employee name and the given employee's manager's name (or whatever get_manager returned for that employee...) note: yes, you can call get_manager from the SQL*Plus level using SQL*Plus variables (and you will, below) -- but the purpose here is to include some quick PL/SQL stored procedure practice along with the above PL/SQL stored function practice, along with a little bit of calling-one-PL/SQL-subroutine-from-another-PL/SQL-subroutine thrown in.) Run a commit; to commit the current state of the empl (and other) tables. Insert another employee with the same name as an existing employee except 'King' or 'Raimi' (but a different empl_num...!) Write at least one call to get_manager, declaring a variable at the SQL*Plus level to hold the result and then using a print command to output the value of that variable Also put in example calls to show_manager with: ...the argument 'Raimi' ...the argument 'King' (who has no manager) ...the argument 'Wilbon' (who is not an employee) ...the argument that is the name of two different employees (you may include additional example calls if you'd like) Run a rollback; to restore the state of the empl

PL/SQL is required for the function and procedure, a picture of the

EMPL EMPL_LAST_NAME SALARY COMMISSION DEP 7839 King 7566 Jones 7698 Blake 7782 Raimi 7902 Ford 7369 Smith 7499 Michaels 7521 Ward 7654 Martin 7788 Scott 7844 Turner JOB_TITLE MGR HIREDATE President 17-NOV-91 Manager 7839 02-APR-91 Manager 7839 01-MAY-91 Manager 7839 09-JUN-91 Analyst 7566 03-DEC-91 clerk 7902 17-DEC-90 Sales 7698 20-FEB-91 Sales 7698 22-FEB-91 Sales 7698 28-SEP-91 Analyst 7566 09-NOV-91 Sales 7698 08-SEP-91 5000 2975 2850 2450 3000 800 1600 1250 1250 3000 1500 500 200 300 100 200 200 300 300 500 300 1400 300 200 0 300 EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP 7876 Adams 7900 James 7934 Miller Clerk clerk clerk 7788 23-SEP-91 7698 03-DEC-91 7782 23-JAN-92 1100 950 1300 400 300 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!