Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for queries that return multiple result sets #29

Merged
merged 2 commits into from

2 participants

@zengineerus

No description provided.

@zengineerus

Fixed a typo, changed to print a line rather than just a plain print.

@neurolabs neurolabs merged commit f1b3698 into neurolabs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 26, 2011
  1. Added support for queries that return multiple result sets.

    Patrick Fitzgerald authored
Commits on Apr 27, 2011
  1. Changed output to print a line rather than just a print.

    Patrick Fitzgerald authored
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 16 deletions.
  1. +18 −16 src/henplus/commands/SQLCommand.java
View
34 src/henplus/commands/SQLCommand.java
@@ -241,19 +241,21 @@ public int execute(final SQLSession session, final String cmd, final String para
}
if (hasResultSet) {
- rset = _stmt.getResultSet();
- ResultSetRenderer renderer;
- renderer = new ResultSetRenderer(rset, getColumnDelimiter(), isShowHeader(), isShowFooter(), getRowLimit(),
- HenPlus.out());
- SigIntHandler.getInstance().pushInterruptable(renderer);
- final int rows = renderer.execute();
- SigIntHandler.getInstance().popInterruptable();
- if (renderer.limitReached()) {
- session.println("limit of " + getRowLimit() + " rows reached ..");
- session.print("> ");
- }
- session.print(rows + " row" + (rows == 1 ? "" : "s") + " in result");
- lapTime = renderer.getFirstRowTime() - startTime;
+ do {
+ rset = _stmt.getResultSet();
+ ResultSetRenderer renderer;
+ renderer = new ResultSetRenderer(rset, getColumnDelimiter(), isShowHeader(), isShowFooter(), getRowLimit(),
+ HenPlus.out());
+ SigIntHandler.getInstance().pushInterruptable(renderer);
+ final int rows = renderer.execute();
+ SigIntHandler.getInstance().popInterruptable();
+ if (renderer.limitReached()) {
+ session.println("limit of " + getRowLimit() + " rows reached ..");
+ session.print("> ");
+ }
+ session.println(rows + " row" + (rows == 1 ? "" : "s") + " in result");
+ lapTime = renderer.getFirstRowTime() - startTime;
+ } while (_stmt.getMoreResults());
} else {
final int updateCount = _stmt.getUpdateCount();
if (updateCount >= 0) {
@@ -387,9 +389,9 @@ public int execute(final SQLSession session, final String cmd, final String para
if (aliases.size() == 1) {
completer.addName(col);
} else {
- for (String name : aliases) {
- completer.addName(name);
- }
+ for (String name : aliases) {
+ completer.addName(name);
+ }
}
}
return completer.getAlternatives(lastWord);
Something went wrong with that request. Please try again.