Sqsh on NT

Please note that the following is simply a copy of the README file that is included with the sqsh for NT package.

Cygwin

Sqsh is made possible on NT, thanks to the CYGWIN project. CYGWIN is a UNIX compatibility toolkit that makes porting sqsh (nearly) as easy as a simple re-compilation.

In order to use sqsh, you *must* have CYGWIN installed. If you don't have it you can get it from:

http://sources.redhat.com/cygwin/

In particular sqsh requires access to CYGWIN1.DLL. So, either make sure that CYGWIN1.DLL is in your PATH, or only run sqsh while using the cygwin environment (there is a cygwin.bat file that gets installed with cygwin that will drop you into a bash prompt that'll be nicely configured).

You really only need the most basic cygwin install to work with sqsh, but I highly recommend installing the whole thing as it gives you the tools that can really make life with sqsh worthwhile (sed, awk, grep, bash, etc.).

NOTE: I *cannot* help you with CYGWIN issues. I spent just enough time with it to compile sqsh and run it once on my laptop. I spend all of my time on either Linux or Sun, so most likely by the time you read this, I have probably already forgotten all that I new about cygwin. Your best bet for help is probably comp.databases.sybase or one of the cygwin mailing lists.

Directory Paths

PLEASE PLEASE PLEASE: Read the CYGWIN documentation on how to work within the cygwin environment. In particular, pay close attention to path naming conventions, which are different from those of NT. Namely:

This is particularly important when setting variables within sqsh or environment variables used by sqsh to configure it's behavior. Sqsh will all paths according to cygwin rules.

Pre-Installation Checklist

Before you begin the installation, make sure that you have the following:

  1. A full Open Client installation. By full, I mean that you have the %SYBASE%/dll directory and that the directory contains libblk.dll. Unfortunately, it seems that some products don't install this DLL.

    IF YOU DON'T HAVE THIS DLL, I CAN'T GIVE IT TO YOU! Mainly I am not sure of the legal ramifications of giving out this DLL, however, you could ask around the internet, or simply install the Open Client developers libraries.
  2. Your %SYBASE% variable points to the right location.
  3. %SYBASE%/dll is in your path.
  4. Cygwin is installed and working properly (see notes above).

Installation

Alas, unfortunately, you are installing the NT version of sqsh which is not *quite* as automated as I would like (in fact, it is not automated at all!!).

  1. Copy sqsh.exe wherever you want to use it (or simply leave it where it is now...your choice). Obviously, life is a bit easier if sqsh.exe is in your PATH (%SYBASE%/bin is a nice choice).

    In the remainder of the steps below, I'll refer to the installation directory as SQSH_HOME.
  2. (optional, but recommended) Copy the file doc/global.sqshrc to SQSH_HOME/global.sqshrc.

    Create a global environment variable SQSHRC that is set to the following:
    	SQSHRC=SQSH_HOME/global.sqshrc:${HOME}/.sqshrc

    Sqsh will attempt to read every sqshrc file in this environment variable path during startup, so the setting above will cause sqsh to first read the global configuration file, followed by (optionally) a user-specific config file.

    Please note that SQSH_HOME (and $HOME) should follow cygwin path naming conventions.
  3. (optional, but recommended) Create a user-specific environment variable called HOME that points to the location that you want sqsh to use to (a) read your local .sqshrc file (if you choose to create one), (b) place state information (command line history, sql buffer history). %HOME% does not *have* to conform to cygwin naming conventions, but it is recommended.

Then you should be off and running.

Additional Files

Note that there are some additional sample configuration files that are included in the doc/ directory that are not installed but are probably worth taking a look at.