ISQL, SQSH .......


We can interact with a database in lot of ways. We can send commands through perl::DBI interface, write a stored procedure, use an interactive shell etc. The last one is the easiest.

Sybase provides a shell called isql. There's a much better utility called sqsh . We will be using sqsh only throughout this course.

Sqsh (pronounced skwish) short for SQshelL (pronounced s-q-shell), and is intended as a replacement for the venerable `isql' program supplied by Sybase. It is developed due to years of frustration of trying to do real work with a program that was never meant to perform real work.

sqsh is like your unix shell where you type commands like 'ls' etc. Here you type sql commands and interact with database. It also has powerful shell features like variables, aliasing, redirection, pipes, back-grounding, job control, history, command substitution, and dynamic configuration. Also, as a by-product of the design, it is remarkably easy to extend and add functionality.

You can start sqsh by typing the following commands at unix prompt

    source /local/etc/sybase.cshrc
    sqsh

You might want to put the first line in your .cshrc

From now on, you can type sql commands. See SQL Tutorial for sql usage.

For more details on sqsh, type the following command

    sand 1% man sqsh 

This command gives you a complete listing of the sqsh help tutorial.

TIP: sqsh also allows you to type a command and end it with a semicolon. To enable this behaviour, write the following line in .sqshrc file in home directory

    \set semicolon_hack=1
Now onwards you can type the command and end it with a semi-colon as follows:
    sp_who;
In this way, one does not need to enter the go command.

Back to Sybase Home Page