Skip to content

CREATE TRIGGER sql queries do NOT get parsed nor validated. #1453

Closed
@atharmutallib

Description

@atharmutallib

Describe the bug
CREATE TRIGGER sql queries do NOT get parsed nor validated.

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL: create trigger stud_marks before INSERT on Student for each row set Student.total = Student.subj1 + Student.subj2, Student.per = Student.total * 60 / 100;
  2. Parsing this SQL using JSqlParser with this statements
  3. Exception:
    net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "create" "CREATE"
    at line 1, column 1.

Was expecting one of:

"("
"ALTER"
"CALL"
"COMMENT"
"COMMIT"
"DECLARE"
"DELETE"
"DESCRIBE"
"DROP"
"EXEC"
"EXECUTE"
"EXPLAIN"
"GRANT"
"INSERT"
"MERGE"
"PURGE"
"RENAME"
"RESET"
"ROLLBACK"
"SAVEPOINT"
"SET"
"SHOW"
"TRUNCATE"
"UPDATE"
"UPSERT"
"USE"
"VALUES"
"WITH"
<K_SELECT>


at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)

Expected behavior
Should parse the sql. If validated, no errors should exist.

System

  • Database you are using: IBM DB2
  • Java Version: Java 8
  • JSqlParser version: 4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions