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);
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);
elseQuery.setCriteria(criteria);
Command elseQueryCmd = elseQuery;
AssignmentStatement elseQueryStmt = new AssignmentStatement(var2, elseQuery);
Block elseBlock = new Block();
List elseStmts = new ArrayList();
elseStmts.add(elseDeclStmt);
elseStmts.add(elseQueryStmt);
elseBlock.setStatements(elseStmts);
//has criteria
ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
List elements = new ArrayList();
elements.add(a);
CriteriaSelector critSelector = new CriteriaSelector();
critSelector.setSelectorType(CriteriaSelector.IS_NULL);
critSelector.setElements(elements);
HasCriteria hasSelector = new HasCriteria();
hasSelector.setSelector(critSelector);
IfStatement stmt = new IfStatement(hasSelector, ifBlock, elseBlock);
Block block = new Block();
block.addStatement(declStmt);
block.addStatement(stmt);
CreateUpdateProcedureCommand cmd = new CreateUpdateProcedureCommand();
cmd.setBlock(block);
helpTest(procedureString, "CREATE PROCEDURE"+"\n"+"BEGIN"+"\n"+"DECLARE short var1;"+"\n"+ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$