HenPlus is a SQL shell that can handle multiple sessions in parallel. The commandline interface with the usual history functions features TAB-completion for commands, tables and columns. Database connect via JDBC.
help set-var-from-query
SYNOPSIS: set-var-from-query []
DESCRIPTION: Wit is retrieved from the sql query. The first colomn from the first row is used to set the variable. Variables are expanded in any command you issue on the commandline. Variable expansion works like on the shell with the dollarsign. Both forms, $VARNAME and ${VARNAME}, are supported. If the variable is not set, then the text is left untouched. So if there is no variable $VARNAME, then it is not replaced by an empty string but stays '$VARNAME'. This is because some scripts use wierd identifiers containting dollars (esp. Oracle scripts) If you want to quote the dollarsign explicitly, write two dollars: $$FOO means $FOO Requires valid session.
help set-var-from-query SYNOPSIS: set-var-from-query [ ]
DESCRIPTION: Wit is retrieved from the sql query. The first colomn from the first row is used to set the variable. Variables are expanded in any command you issue on the commandline. Variable expansion works like on the shell with the dollarsign. Both forms, $VARNAME and ${VARNAME}, are supported. If the variable is not set, then the text is left untouched. So if there is no variable $VARNAME, then it is not replaced by an empty string but stays '$VARNAME'. This is because some scripts use wierd identifiers containting dollars (esp. Oracle scripts) If you want to quote the dollarsign explicitly, write two dollars: $$FOO means $FOO Requires valid session.
https://gist.github.com/759803