0
CREATE OR REPLACE TRIGGER bi_payregister
  BEFORE INSERT
  ON payregister
  FOR EACH ROW
BEGIN
  SELECT helloabc.NEXTVAL INTO :new.id FROM DUAL;
END

what is wrong with this statement, it shows error.I have created PAYREGISTER table and HelloABC sequence already.

2
  • And what is the error? Commented Mar 31, 2015 at 14:29
  • Error(2,58): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ; <an identifier> <a double-quoted delimited-identifier> The symbol ";" was substituted for "end-of-file" to continue. Commented Mar 31, 2015 at 14:30

1 Answer 1

2

Assuming you're talking about the syntax error that your code produces, you're missing the semi-colon (and forward slash) off the end of the "END". It should be:

CREATE OR REPLACE TRIGGER bi_payregister
  BEFORE INSERT
  ON payregister
  FOR EACH ROW
BEGIN
  SELECT helloabc.NEXTVAL INTO :new.id FROM DUAL;
END;
/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.