neurolabs / henplus

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.
GNU General Public License v2.0
98 stars 51 forks source link

Patch: set_var_from_query command #3

Open tbk303 opened 13 years ago

tbk303 commented 13 years ago

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

neurolabs commented 13 years ago

Submitted:

Nobody/Anonymous ( nobody ) - 2008-03-25 14:29:54 UTC

neurolabs commented 13 years ago

There is the beanshell integration, which makes this and more possible. We should try to get the beanshell integration into the master repo.