Delete d1 = new Delete();
d1.setGroup(new GroupSymbol("g")); //$NON-NLS-1$
CommandStatement cmdStmt = new CommandStatement(d1);
AssignmentStatement assigStmt = new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
RaiseErrorStatement errStmt = new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
Block ifblock = new Block();
ifblock.addStatement(cmdStmt);
ifblock.addStatement(assigStmt);
ifblock.addStatement(errStmt);
// construct If criteria
ElementSymbol sy1 = new ElementSymbol("x"); //$NON-NLS-1$
List elmnts = new ArrayList(1);
elmnts.add(sy1);
CriteriaSelector cs = new CriteriaSelector(CriteriaSelector.LIKE, elmnts);
Criteria crit = new HasCriteria(cs);
Block elseblock = new Block();
elseblock.addStatement(cmdStmt);
IfStatement ifStmt = new IfStatement(crit, ifblock, elseblock);
helpTest(ifStmt, "IF(HAS LIKE CRITERIA ON (x))\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND\nELSE\nBEGIN\nDELETE FROM g;\nEND"); //$NON-NLS-1$
}