Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL command not properly ended

Tachyon97May 5 2017 — edited May 8 2017

Hello friends! I have been mindlessly stuck on a  question for my class for about an hour now, and I was hoping to receive some insight on what I may be doing wrong. Here is the question:

Create a row trigger that displays the maximum salary in the EMPLOYEES table and is fired immediately before an employee’s salary is updated.

This is my code:

CREATE OR REPLACE TRIGGER max_sal_trigger

BEFORE UPDATE OF salary ON employees FOR EACH ROW

  DECLARE

   max_sal NUMBER;

  BEGIN

   SELECT max(salary) FROM employees INTO max_sal;

   DBMS_OUTPUT.PUT_LINE('The Maximum salary is' || max_sal || '.');

  END;

And here is my error: Error at line 4: PL/SQL: ORA-00933: SQL command not properly ended

Thank you so much in advance!

-Shaun

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2017
Added on May 5 2017
3 comments
4,576 views