try {
value = expressions[0].getValue(session);
} catch (HsqlException e) {}
if (value instanceof Result) {
Result result = (Result) value;
if (result.isData()) {
Object[] data =
(Object[]) result.getNavigator().getNext();
boolean single = !result.getNavigator().next();
if (single && data != null && data[0] != null) {
value = data[0];
result.getNavigator().close();
} else {
result.getNavigator().close();
return Result.newErrorResult(
Error.error(ErrorCode.X_22009), sql);
}
} else {