in reply to Re^6: sth->execute returns undef when successful
in thread sth->execute returns undef when successful

With it only failing on long running queries, I'm guessing it's a resource problem of some sort . I would try running it with restricted rows by adding where ROWNUM <= 10000 (for example) and if that works increase the size until it fails.

poj