in reply to sth->execute returns undef when successful

Hi, Please put your trace output inside <code></code> tags.

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: sth->execute returns undef when successful
by Anonymous Monk on Aug 10, 2015 at 14:17 UTC
    Below is the trace: Fyi: the perl script in question reads in metadata and builds out the create table statement then calls a procedure that does the prepare, execute and finish. For the trace I copied the CTAS it was executing and put it in a simple perl script with RaiseError. Just to see how that would work. With RaiseError it does not get an error, but you can see it is returning the undef. Thank you for the repsoneses so far.
    DBI::st=HASH(0x15783d0) trace level set to 0x0/14 (DBI @ 0x0/0) in DB +I 1.609-ithread (pid 26383) -> execute for DBD::Oracle::st (DBI::st=HASH(0x16e9b28)~0x15783d0) + thr#154e010 dbd_st_execute CREATE (out0, lob0)... Statement Execute Mode is 0 (DEFAULT) OCIStmtExecute(19c18d8,19cd328,19b9f68,1,0,0,0,mode=DEFAULT,0) +=SUCCESS OCIAttrGet(19cd328,OCI_HTYPE_STMT,7fffb492eec8,0,OCI_ATTR_ROW_ +COUNT,19b9f68)=SUCCESS OCIAttrGet(19cd328,OCI_HTYPE_STMT,7fffb492eece,0,OCI_ATTR_SQLF +NCODE,19b9f68)=SUCCESS dbd_st_execute CREATE returned (SUCCESS, rpc2211750915, fn1, o +ut0) <- execute= undef at ./test_query.pl line 80 -> finish for DBD::Oracle::st (DBI::st=HASH(0x16e9b28)~0x15783d0) +thr#154e010 <- finish= 1 at ./test_query.pl line 98 -> DESTROY for DBD::Oracle::st (DBI::st=HASH(0x15783d0)~INNER) thr +#154e010 dbd_st_destroy OCIHandleFree(19cd328,OCI_HTYPE_STMT)=SUCCESS <- DESTROY= undef
      The table creates successfully (I can query the table after program exits with error).

      I don't understand how this happens with the rollback statement.
      What do you have AutoCommit set to ?

      $sth->execute() or do { $msg = "ERROR:$0: Error in SQL execute:\n$DBI::errstr"; $dbh->rollback(); confess "$msg"; };
      poj
        In this script it was originally not set. I tested with it turned off and it did not change anything.