query.setFrom(from);
query.setCriteria(criteria);
AssignmentStatement queryStmt = new AssignmentStatement(var1, query);
Block ifBlock = new Block();
ifBlock.addStatement(queryStmt);
//else block
ElementSymbol var2 = new ElementSymbol("var2"); //$NON-NLS-1$
Statement elseDeclStmt = new DeclareStatement(var2, shortType);
//element for has criteria
ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
List elements = new ArrayList();
elements.add(a);
List elseSymbols = new ArrayList();
elseSymbols.add(new ElementSymbol("b1")); //$NON-NLS-1$
Select elseSelect = new Select(elseSymbols);
Query elseQuery = new Query();
elseQuery.setSelect(elseSelect);
elseQuery.setFrom(from);
Criteria crit1 = new CompareCriteria(a, CompareCriteria.EQ,
new Constant(new Integer(5)));
ElementSymbol m = new ElementSymbol("m"); //$NON-NLS-1$
Criteria crit2= new CompareCriteria(m, CompareCriteria.EQ,
new Constant(new Integer(6)));
List critList = new ArrayList();
critList.add(crit1);
critList.add(crit2);
TranslateCriteria transCriteria = new TranslateCriteria();
CriteriaSelector critSelector2 = new CriteriaSelector();
transCriteria.setTranslations(critList);
transCriteria.setSelector(critSelector2);
elseQuery.setCriteria(transCriteria);
AssignmentStatement elseQueryStmt = new AssignmentStatement(var2, elseQuery);
Block elseBlock = new Block();
List elseStmts = new ArrayList();
elseStmts.add(elseDeclStmt);
elseStmts.add(elseQueryStmt);
elseBlock.setStatements(elseStmts);
CriteriaSelector critSelector1 = new CriteriaSelector();
critSelector1.setSelectorType(CriteriaSelector.COMPARE_NE);
critSelector1.setElements(elements);
HasCriteria hasSelector1 = new HasCriteria();
hasSelector1.setSelector(critSelector1);
IfStatement stmt = new IfStatement(hasSelector1, ifBlock, elseBlock);
Block block = new Block();
block.addStatement(declStmt);
block.addStatement(stmt);
CreateUpdateProcedureCommand cmd = new CreateUpdateProcedureCommand();
cmd.setBlock(block);
helpTest("CREATE PROCEDURE BEGIN DECLARE short var1;"+ //$NON-NLS-1$