Skip to Content.
Sympa Menu

freetds - Re: [freetds] freetds in a shell script

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freetds in a shell script
  • Date: Tue, 30 Nov 2004 23:28:59 -0500

"Stephen Prowse" <stephen.prowse AT db.com> wrote:
> We have in the past written many shell scripts using sqsh , or isql, in
> the form
>
> sqsh -U -P -S << EOF | sed 's/{tab}$//'> file #where {tab} is the
> control character for tab
> select something
> from somewhere
> whre things match.
> EOF
>
> Process the results
>
> Repeat the command with a different sql statement<<EOF2
> sql statement2
> EOF2
> ....
>
> When trying with freetds , version 0.62.4 , with the same structure the
> commands after the first EOF are ignored. We can get around this by
> calling the sql in separate scripts from a parent but it adds to the
> maintenance. Could anyone advise a way to get the above to work?

I think by "freetds" you mean tsql? It would be interesting to get this
to work with tsql, but that really not its purpose. It's just a testing
tool, not a general script processor.

I'd be interested to hear how you fare with bsqldb.

> I'd continue to use sqsh but from what I can see it won't work against
> MSSQL.

You can use sqsh with Microsoft servers just fine. I do, all the time.
Does that solve the problem?

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page