Question
Create the emp_table below and add the data as shown (/5 Marks)
Write a PLSQL package that inserts a new record in the emp_table table provided below. The package should print the number of records (employees) before the new record was added, the details of the new employee record added, and the new number of employees after the record has been added (/20 Marks)
Write the main PLSQL block to call the created package (/10 Marks)
Create a trigger on the emp_table table that gets executed once the user tries to add a record that has an employee code that matches an already existing code. (/5 Marks)
Package specification
CREATE OR REPLACE PACKAGE EMP_DETAILS IS
PROCEDURE set_record (p_emp_rec IN employee%ROWTYPE);
FUNCTION get_record (p_emp_no IN NUMBER) RETURN employee%ROWTYPE;
END EMP_DETAILS;
/
Table name: emp_table