0

我想在emp.sal < 10.

CREATE OR REPLACE TRIGGER sal_more_than_ten_trigger
  BEFORE INSERT OR UPDATE ON emp FOR EACH ROW
  DECLARE
  sal_lease_than_ten_error EXCEPTION;
  BEGIN
    IF new.sal < 10 THEN -- error occured!!!!!!!!!!!!!!!!!!!!!!!!!
      RAISE sal_lease_than_ten_error;
    END IF;
  EXCEPTION
  WHEN sal_lease_than_ten_error THEN
  RAISE_APPLICATION_ERROR(-20001, 'give me more');
END;
/

我如何比较 newemp.sal10

4

1 回答 1

2

您忘记了前面的冒号new

IF :new.sal < 10 THEN
于 2015-11-08T01:51:37.020 回答