fetchrow_hashref

"Rob Lauer" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <051a01c4c6d8$fe043260$9c8c19ac@DELLROBLAUE>
Excuse me if this is already posted....

I've searched the list and googled with my best googling but I don't seem to be able to find the answer to this one:

I've been having this odd problem where a "select" query returns a hashref that contains 

COL(1) => 0

when I'm expecting the values from the query.  I've implemented the 'syb_more_results' code, but I still seem to get bogus results from a fetch.

I sprinkled the syb_more_results, but to no avail.  It's as if the query is getting someone else's result set.

do {
while (my $ref = $sth->fetchrow_hashref() ) {
 ..blah blah
} while ($sth->{syb_more_results});

freetds 0.62.1
DBD::Sybase 1.02

..all running on HP-UX 11i

The statement in question is a UNION of two selects and does not use any stored procedures afaik, although I do use a built-in function (convert) to format a date.  The probem is intermittent.  The same query wil sometimes work perfectly, other times instead of the expected rows, I get the aforementioned result.

I am using 2 statement handles.  An outer loop does a one query and based on those rows an inner query.

Any thoughts?

Robert C. Lauer
Director, Systems Development
Charles Jones Inc.
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.