It would be of great help if there was a -silent or -s
option on the comand line like in SQLPlus that would
remove all the gratuitous output like the startup
output, the prompt and the timing so that it only
outputs the result of the query, nothing else.
I mainly need this so I can select a value from a
database column directly into a Unix environment
variable. This would be an example -
#!/bin/sh
VALUE=`henplus -silent user/password@instance <<END
set-property sql-result-showheader off
set-property sql-result-showfooter off
set-property column-delimiter ""
select max(c1) from t1;
exit
END`
if [ -z "$VALUE" ]; then
echo "No rows returned from database"
exit 0
else
echo $VALUE
fi
Contact email - carlg8@excite.com
Logged In: NO
A very essential request I think.
We have started to switch our DB-platform from Postgres to
C-JDBC, and one of the consequences of this is that all
database access now have to be performed via the C-JDBC jdbc
driver (no psql or other non-jdbc SQL utilities alloved any
more).
As I'm used to performing most of my SQL work using
command-line utilities such as psql (or sql-plus if you
want), we now have to find a new command-line utility.
I have been looking around and it seems like henplus is one
of the few jdbc-based utilities around devoted to the
command-line.
As a command-line tool it must have good scripting support
of course. Please fix the silent-flag. All these
"user-friendly" gui-based SQL-tools are close to worthless
for professional work!
olle@compound.se