Skip to Content.
Sympa Menu

freetds - Re: [freetds] fisql or ssqldb or sqsh.....

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Keehan Mallon <keehan_mallon AT yahoo.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] fisql or ssqldb or sqsh.....
  • Date: Wed, 20 May 2009 11:04:11 -0700 (PDT)

I just finished changing our code to work using bsqldb with the -i, -o, -e
syntax. I would have used the here-doc syntax if I thought it was supported.
I looked at the man page, but didn't understand that here-doc style was an
option. I guess I should have got that from the statement that bsqldb is a
filter and can use standard input, output and error.

Thanks for the reply. It seems like a very easy to use utility. It is very
nice that the FreeTDS utilities are so compatible with the MS utilities. I
have now ported bcp to freebcp and osql to bsqldb.

Cheers,

Keehan




________________________________
From: James K. Lowden <jklowden AT freetds.org>
To: Keehan Mallon <keehan_mallon AT yahoo.com>; FreeTDS Development Group
<freetds AT lists.ibiblio.org>
Sent: Tuesday, May 19, 2009 10:17:14 PM
Subject: Re: [freetds] fisql or ssqldb or sqsh.....

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








Archive powered by MHonArc 2.6.24.

Top of Page