@Override public Value getValue(Session session) { query.setSession(session); ResultInterface result = query.query(1); session.addTemporaryResult(result); boolean r = result.hasNext(); return ValueBoolean.get(r); }
/** * Checks if the current position is before the first row, that means next() * was not called yet, and there is at least one row. * * @return if there are results and the current position is before the first * row * @throws SQLException if the result set is closed */ @Override public boolean isBeforeFirst() throws SQLException { try { debugCodeCall("isBeforeFirst"); checkClosed(); return result.getRowId() < 0 && result.hasNext(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Checks if the current position is the last row, that means next() was * called and did not yet returned false, but will in the next call. * * @return if the current position is the last row * @throws SQLException if the result set is closed */ @Override public boolean isLast() throws SQLException { try { debugCodeCall("isLast"); checkClosed(); int rowId = result.getRowId(); return rowId >= 0 && !result.isAfterLast() && !result.hasNext(); } catch (Exception e) { throw logAndConvert(e); } }
@Override public Value getValue(Session session) { query.setSession(session); try (ResultInterface result = query.query(2)) { Value v; if (!result.next()) { v = ValueNull.INSTANCE; } else { Value[] values = result.currentRow(); if (result.getVisibleColumnCount() == 1) { v = values[0]; } else { v = ValueArray.get(values); } if (result.hasNext()) { throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW); } } return v; } }
/** * Moves the current position to the last row. * * @return true if there is a row available, false if not * @throws SQLException if the result set is closed */ @Override public boolean last() throws SQLException { try { debugCodeCall("last"); checkClosed(); if (result.isAfterLast()) { resetResult(); } while (result.hasNext()) { nextRow(); } return isOnValidRow(); } catch (Exception e) { throw logAndConvert(e); } }
if (!rows.hasNext()) { return ValueBoolean.get(all); } else if (l == ValueNull.INSTANCE) {
return !res.hasNext();
while (true) { resultInterface = right.query(0); if (!resultInterface.hasNext()) { break;
return !res.hasNext();