Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Oracle SQL Create a script that uses a database trigger to output messages that

ID: 3708434 • Letter: O

Question

Oracle SQL

Create a script that uses a database trigger to output messages that describe the records that are entered into a table. The script must perform the following:

Create a database trigger, "emp_insert_t1" that will display a message for each record that has been entered into the "emp" table. The message should contain the employee number, employee name and the employee salary. The following is an example of an output message.


"Record entered for employee Jackson with employee number 1234 and salary 25000"

Insert 10 records into the "emp" table.

Explanation / Answer

The emp_insert_t1 trigger is below, which displays the message when a new record is inserted to the emp table. The trigger evoked when an employee details is inserted to the tables.

Trigger-

CREATE or REPLACE TRIGGER emp_insert_t1 AFTER INSERT ON emp
FOR EACH ROW
DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Record entered for' || :new.empName || 'with enployee number ' || :new.empid ' || and salary ' || "new.empSalary);
END;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote