Skip to Content.
Sympa Menu

freetds - [freetds] FreeTDS --> DBD::ODBC - Errors not being raised

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Kasak <dkasak AT nusconsulting.com.au>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] FreeTDS --> DBD::ODBC - Errors not being raised
  • Date: Wed, 01 Feb 2006 14:24:47 +1100

Hi all.

I'm using FreeTDS-0.62.4 with DBD-ODBC-1.13 and unixODBC-2.2.11 to connect to SQL Server 7.

I just found something disturbing ...

I've got code that goes:

---

eval{
$sth = $dbh->prepare( $sql ) || die $dbh->errstr;
}

if ( $@ ) {
# complain
}

eval {
$sth->execute || die $dbh->errstr;
}

while ( my @row = $sth->fetchrow_array ) {
# stuff
}

---

The problem is that my $sql was bad, and I didn't get any warnings. The code ran straight through, and simply jumped over the fetchrow_array part as if there were no records. I copied $sql into SQL Server's query analyser, and it told me that there were 2 ambiguous column names in my query! So I fixed these by referring to the fields in table.field format, and now I get the expected results.

Is this a known issue? It's quite easy to reproduce on my system ...

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak AT nusconsulting.com.au
website: http://www.nusconsulting.com.au



  • [freetds] FreeTDS --> DBD::ODBC - Errors not being raised, Daniel Kasak, 01/31/2006

Archive powered by MHonArc 2.6.24.

Top of Page