On Wed, Apr 09, 2008 at 04:29:48PM -0700, Douglas Wilson wrote: > With DBI 1.602 and DBD::Sybase 1.08 I get: > Can't locate object method "DELETE" via package "DBI::st" > on the second selectrow_array call. > > If I replace $sth with $sql in the selectrow_array calls, then it > works correctly. > I did find a similar problem here: > http://www.nntp.perl.org/group/perl.dbi.users/2007/06/msg31486.html > > but I thought that was fixed (did it get unfixed? :-) > I get the same error whether or not I have placeholders and bind parameters. > > Here's the code: > > use DBI; > > my $dbh = DBI->connect( > 'dbi:Sybase:server=SERVERNAME;database=dbname', > 'user_name', 'password', { RaiseError => 1 }); > my $sql = 'select some_column from my_table where my_id = ?'; > my $sth = $dbh->prepare($sql); > my $id = 10600; > my $total; > ( $total ) = $dbh->selectrow_array( $sth, undef, $id ); > ( $total ) = $dbh->selectrow_array( $sth, undef, $id );
Code looks fine (it's okay to use an $sth instead of sql for the first arg). Looks like a driver bug at first sight. A DBI trace should shed more light on it. Tim.