Skip to Content.
Sympa Menu

freetds - Re: [freetds] testing using tsql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Medi Montaseri" <medi AT resonate.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] testing using tsql
  • Date: Thu, 21 Jun 2007 15:14:09 -0700

For viewers just joining us...the problem statement is

How to run N number of sql request against MS-SQL in a batch mode such
that each request can be delayed and under control of the user...ie a
typical development tool...eg run with sleep 2 or run with pause,
requiring hit-return etc...

Looks like sqlcmd does not like to be used in a batch mode. Unless -I is
(sorry this stupid outlook keeps changing the lower-case I to upper case
I)...anyways...in which case it just reads the entire input.sql file.

I then began looking at bsqldb (on unix) which I can not get to
work...again my usage is to open a pipe to stdin or bsqldb(1) from
within a perl script as in "open (PIPE, "| bsqldb -s etc etc")

Is it possible that bsqldb is just broken....what is the confidence
level on these tools tsql, bsqldb...

I also tried to install DBD::Sybase (as some of the docs mentioned it
would work with MS SQL) I need two help on this
- Does DBD::Sybase work with MS SQL ?
- Installation of DBD::Sybase requires $SYBASE...I don't have such a
thing...I do have libct.so.4, libsybdb.so.5 and libtds ....(the FreeTDS
libs pretty match)...does anyone know how to tell configure of
DBD::Sybase to just use these libs and don't worry about $SYBASE
stuff...most likely that is what it is looking for anyways..

Thanks...
Medi

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Chris Thomas
Sent: Thursday, June 21, 2007 9:07 AM
To: FreeTDS Development Group
Subject: Re: [freetds] testing using tsql

There is a program/language called expect that works with things that
have user prompts. Ive used it in the past to telnet into a router to
get usage stats. Someone wrote a Perl module for expect It is on sf.net.

Here are some links

http://sourceforge.net/projects/expectperl
http://en.wikipedia.org/wiki/Expect
http://expect.nist.gov/

Chris

On Wed, 2007-06-20 at 18:40 -0700, Medi Montaseri wrote:

> Hi,
>
> I am trying to find a way to test an MS SQL engine using tsql(1) from
> a Linux box.
> My input file has over 47000 SQL statements in it.
>
> So I rolled up a perl script to say...
>
> my $input = IO::File->new ( "inputfile.sql"); my $output =
> IO::File->new( "| tsql -H host -P port -U xx -P xxx");
> $output->autoflush(1);
>
> do
> {
> $more = $sql = getSql ( $in );
> sendSql ($out, $sql);
> # recvResponse(....);
> sleep(2); # watch some TV, etc
> } while ( $more );
>
> My problem is with my writes to the pipe above. And tsql prompts and
> bunch of error messages...I might have to insert a function called
> recvResponse() after sendSQL()....and that is where I said, I bet
> someone has already done this....
>
> has anyone cooked up a utilitiy like this....I need to be able to
> insert sleep between sql requests....that is why I can 'nt use tsql
> itself Or maybe there is a way ...
>
> Thanks
> medi
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page