On Wed, Oct 06, 2010 at 07:15:03PM +0100, Martin J. Evans wrote: > Hi, > > Hoping someone can help me identify what might be going on here but > it looks to me like something in DBI has changed. > > use strict; > use DBI; > > my $attrs = { RaiseError => 1, PrintError => 0, AutoCommit => 1 }; > my $h = DBI->connect("dbi:ODBC:DSN=xxx","xx","xx", > {odbc_SQL_ROWSET_SIZE => 2}); > > This code used to work fine but now it fails with: > > Option type out of range (SQL-HY092) at > /home/martin/perl5/lib/perl5/i486-linux-gnu-thread-multi/DBI.pm line > 720.
while ( my ($a, $v) = each %$apply) { eval { $dbh->{$a} = $v } or $@ && warn $@; } Doesn't look like a FETCH to me. Umm, then again, perhaps it is. Try this: - eval { $dbh->{$a} = $v } or $@ && warn $@; + eval { $dbh->{$a} = $v; 1 } or $@ && warn $@; > It appears FETCH is being called on odbc_SQL_ROWSET_SIZE (just my > example, could just as easily have been 9 for the actual ODBC > SQL_ROWSET_SIZE attribute) and this ends up calling > SQLGetConnectOption which says you cannot fetch SQL_ROWSET_SIZE. It > is permissible to set SQL_ROWSET_SIZE with SQLSetConnectOption but > not to retrieve it back. > Why does DBI do a FETCH on the attribute when it is never retrieved > in the script? I don't think it used to (perhaps a long time ago). What does trace show? Tim.