in reply to cygwin DBI DBD:ODBC MS-SQL select returns no rows

How do you mean "having problems"?

If it is that you are returning a blank line, your 0 numerical value returned by count might be being printed as a null string. If that's the case, you can force it into a numerical context, for example by print $row[0]+0,"\n";

Update: To get better diagnostics on DBI's behaviors, I would highly recommend modifying your connect statement to the following:

my $dbh = DBI->connect("dbi:ODBC:$dsn", { PrintError => 1, RaiseError => 0, AutoCommit => 0 } ) || die "Couldn't open database";

Replies are listed 'Best First'.
Re^2: cygwin DBI DBD:ODBC MS-SQL select returns no rows
by MidLifeXis (Monsignor) on Dec 04, 2008 at 16:25 UTC

    Please, please, please use the meme foo or die, not foo || die. In some places || will do what you want, in others it will not. See the main thread on Re^4: selectrow_array() confusion (or vs ||) for an example that bit someone.

    --MidLifeXis