Sqsh is a tool written by Scott Gray, a Sybase professional services consultant based in Philadelphia (and coincidentally a former project team member at a previous client). He has written an open-server based tool that far exceeds the capabilities of the Sybase tool isql for performing interactive SQL tasks. Sqsh stands for SQ-shell and can be found at its home page (this will open in a new browser window).
The extensive man page can be found in sqsh.1, which comes with the sqsh distribution. To view this man page you'll need to execute this command:
% nroff -man sqsh.1 | more
The advantages of sqsh include:
% isql -Usa -S[server] -P[password] -H[hostname]is replaced by simply typing
% sqshand by having all the other options designated in your chmod'd 400 .rc file.
1> select * from syslogins 2> go | morethe SQSH program pipes the output of the select statement through the unix command more! You can also redirect input and output to files, pipe output to unix other unix commands, and generally do most any type of file manipulation thats available in shell (including backgrounding of jobs and decent job control).
Here's an example .sqshrc file; edit this file in your home directory
and chmod 400 it if you're keeping cleartext passwords in it.
\set banner=no \set username="sa" \set password="[password]" \set hostname="Boss_sqsh" \set history_shorthand=on \set statistics=off \set semicolon_hack=off \set database=db_name \set prompt="SERVER >" \alias clear="\shell clear" \alias r="\buf-load " \alias :r="\buf-load " \alias sh="\shell " \set style="bcp" \alias gob="\go -m bcp" \alias goh="\go -m hor"the options are as follows: