On Tue, Apr 15, 2008 at 09:00:56PM +0200, Michael Peppler wrote:
> 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.
>>
>> ( $total ) = $dbh->selectrow_array( $sth, undef, $id );
>> ( $total ) = $dbh->selectrow_array( $sth, undef, $id );
>
> I was able to reproduce it.

Great.

> I don't know yet if this is a DBD::Sybase problem or something else.
> Unfortunately I don't have much time to debug this.

Try this (completely untested) patch to the DBI:

--- Driver.xst  (revision 10993)
+++ Driver.xst  (working copy)
@@ -157,7 +157,11 @@
     AV *row_av;
     PPCODE:
     if (SvROK(ST(1))) {
-   sth = ST(1);
+        MAGIC *mg;
+        sth = ST(1);
+        /* switch to inner handle if not already */
+        if ( (mg = mg_find(SvRV(sth),'P')) )
+            sth = mg->mg_obj;
     }
     else {
    /* --- prepare --- */

(For a quick test it's probably easiest to apply it to the preprocessed
Driver.xsi in the DBD::Sybase directory after a 'make'.)

Tim.

Reply via email to