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

James K. Lowden jklowden at freetds.org
Wed May 20 01:17:14 EDT 2009


Keehan Mallon wrote:
> I need to be able to issue something like:
> 
> fisql -S $tdsname -U $user -P $password -Q $SQL

Why not use a here-document:

$ cat t.sql
#! /bin/sh

bsqldb -U$U -P$P -S$S <<SQL
select type, xusertype, allownulls
from systypes
where variable = 1
SQL

$ ./t.sql
type  xusertype  allownulls
----  ---------  ----------
  39        231           1
  39        256           0
  37        165           1
  39        167           1
4 rows affected

Adding a -C or -Q option to bsqldb wouldn't be hard, but reading from
standard input is much more flexible.  

HTH.  

--jkl



More information about the FreeTDS mailing list