I tried the following statement taken from Firebird:

CREATE TRIGGER tr_path FOR t_path
BEFORE INSERT
AS
BEGIN
  IF (NEW.c_pathId IS NULL) THEN NEW.c_pathId = GEN_ID(s_path, 1);
<-------- error
END;

and got at the marked position the message

Syntax error in SQL statement "CREATE TRIGGER TR_PATH FOR[*] T_PATH...
expected "AFTER"

I'll fix it somehow (I see already that the table name must come later
and that there must be "ON" instead of "FOR"), but I'd expect a
message enumerating _all possibilities_, i.e., INSTEAD, BEFORE, and
AFTER. The org.h2.command.Parser uses an expectedList, so this should
work but does not.

It looks like only ErrorCode.SYNTAX_ERROR_1 gets reparsed, but in my
case ErrorCode.SYNTAX_ERROR_2 happened. Additionally,
Parser.read(String expected) ignores the expectedList. I changed both
and it works better for me now, but without more understanding it all
may be completely wrong. I didn't attached the trivial patch, as it'd
get broken by the stupid (de-)formatting, anyway.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to