[freetds] fisql or ssqldb or sqsh.....

Keehan Mallon keehan_mallon at yahoo.com
Mon May 18 14:34:07 EDT 2009


I have setup and configured FreeTDS and unixODBC.  I can connect to Oracle and SQL Server using native tools and ODBC.  What I am needing is a native tool to connect to SQL Server from shell scripts and run SQL jobs.  In particular, I need to be able to issue something like:

fisql -S $tdsname -U $user -P $password -Q $SQL

The code that I am working on used a structure similar to that, but it was a Windows utility (running from Microsoft's Services for UNIX.

With the existing fisql and/or bsqldb, I could echo $SQL > file and then use fisql to run the file, but I'd rather not have to write the file to disk every time I try to run a query.  Can either of these tools take the $SQL inline?

My other option is sqsh.  It seems to be able to take the SQL argument inline.  However, I have been unable to get it to configure.  I have FreeTDS installed via rpm, so the FreeTDS libs are in /usr/lib64, executables in /usr/bin and the includes in /usr/include.  I have not been able to set the SYBASE variable to any path that configure was able to use to find the sybase libs.  Anybody have any idea if what I am trying should work?  Where should I be pointing SYBASE in this instance?

I'd rather not have to compile FreeTDS from source as I would have to go back and do the same for unixODBC as well then.

Thanks,

Keehan



      



More information about the FreeTDS mailing list