Question

CREATE OR REPLACE TRIGGER First_Initial_Last_Name AFTER INSERT OR UPDATE OR DELETE ON EVALUATIONS DECLARE log_action First_Initial_Last_Name_Log.action%TYPE;...

CREATE OR REPLACE TRIGGER First_Initial_Last_Name

AFTER INSERT OR UPDATE OR DELETE

ON EVALUATIONS

DECLARE

log_action First_Initial_Last_Name_Log.action%TYPE;

BEGIN

IF INSERTING THEN

log_action := 'Insert';

ELSIF UPDATING THEN

log_action := 'Update';

ELSIF DELETING THEN

log_action := 'Delete';

ELSE

DBMS_OUTPUT.PUT_LINE('This code is not reachable.');

END IF;

eventid:= eventid_seq.NEXTVAL;

INSERT INTO First_Initial_Last_Name_Log(eventid,log_date, action)

VALUES (eventid,SYSTIMESTAMP, log_action);

END;

I am getting an error report: ORA-00942: table or view does not exist. What is throwing this error?

Homework Answers

Answer #1

Create the table  EVALUATIONS first.

commit it;

Then try to create the trigger.

As the trigger you are creating will work on EVALUATIONS table after every  INSERT OR UPDATE OR DELETE operation is done on the EVALUATIONS table.

The rest you are doing in the begin section is the trigger functionality. For Trigger to be created you definitely need the table first. So create the table . commit and then create trigger. Run.

Hope it is running now.

N.B: For any further query please contact through comments. Thank you.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT