Token checkTok = null;
Token endToken;
int actionBegin;
int actionEnd;
int triggerEvent;
QueryTreeNode actionNode;
ResultColumnList triggerColumns = (ResultColumnList) nodeFactory.getNode(
C_NodeTypes.RESULT_COLUMN_LIST,
getContextManager());
Vector refClause = null;
jj_consume_token(TRIGGER);
triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
isBefore = beforeOrAfter();
triggerEvent = triggerEvent(triggerColumns);
jj_consume_token(ON);
tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
switch (jj_nt.kind) {
case REFERENCING:
refClause = triggerReferencingClause();
break;
default:
jj_la1[226] = jj_gen;
;
}
switch (jj_nt.kind) {
case FOR:
jj_consume_token(FOR);
jj_consume_token(EACH);
isRow = rowOrStatement();
break;
default:
jj_la1[227] = jj_gen;
;
}
switch (jj_nt.kind) {
case MODE:
jj_consume_token(MODE);
jj_consume_token(DB2SQL);
break;
default:
jj_la1[228] = jj_gen;
;
}
//we are not top level statement
actionNode = proceduralStatement(tokenHolder);
actionEnd = getToken(0).endOffset;
actionBegin = tokenHolder[0].beginOffset;
// No DML in action node for BEFORE triggers.
if (isBefore.booleanValue() && (actionNode instanceof DMLModStatementNode)) {
{if (true) throw StandardException.newException(
SQLState.LANG_UNSUPPORTED_TRIGGER_STMT,
((StatementNode) actionNode).statementToString(), "BEFORE");}
}
// no params in trigger action
HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
actionNode.accept(visitor);
if (visitor.hasNode())
{
{if (true) throw StandardException.newException(SQLState.LANG_NO_PARAMS_IN_TRIGGER_ACTION);}
}