On Wed, Sep 19, 2001 at 11:12:53AM -0500, Dean Kopesky wrote:
> Hi!
> 
> When an execute() produces multiple result sets, some statement handle
> attributes (notably NAME_lc and NAME_uc, but there are others) do not change
> between the result sets.  The attached code demonstrates this.  These
> attributes appear to be cached within DBI.  I can see three possible fixes:
> 
> (1)  Have DBD::Sybase override the accessor with one that doesn't cache.
> (2)  Have DBI never cache attributes.
> (3)  Have DBI provide some mechanism the drivers can use to suppress the
>      caching, and have DBD::Sybase use that.

Better to:

  (4)  Have DBD::Sybase delete the cached attributes between result sets.

Tim.

> (I have also posted this to the DBD::Sybase bug list.)
> 
> Thanks much!
> 
> -Dean Kopesky, Bridge Information Systems, [EMAIL PROTECTED]
> 
> 
> #!/usr/local/bin/perl5 -w
> 
> use strict;
> use DBI;
> 
> my $dbh = DBI->connect( 'dbi:Sybase:_server_', _user_, _password_ );
> 
> my $sql = <<'/EOD';
> SELECT * FROM sysobjects
> SELECT * FROM sysindexes
> /EOD
> 
> my $sth = $dbh->prepare($sql);
>    $sth->execute();
> 
> do {
>         print "NAME    @{$sth->{'NAME'}}\n";
>         print "NAME_lc @{$sth->{'NAME_lc'}}\n";
>         print "NAME_uc @{$sth->{'NAME_uc'}}\n";
>         my $rowcount = 0;
>         while ( $sth->fetch() ) { $rowcount++; }
>         print "#ROWS = $rowcount\n";
> }
>         while( $sth->{'syb_more_results'} );

Reply via email to