Re: fetchrow_hashref

Michael Peppler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
On Wed, 2004-11-10 at 04:54, Rob Lauer wrote:
> 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 got the same thing the other day. Apparently MS-SQL 2k will sometimes
return a "status" result if the index statistics have been recomputed
(or for other reasons). I believe that the FreeTDS folks have fixed this
in the CVS version of the code.
My work-around was to check for the syb_result_type, and if I had issued
a normal SELECT and I got a CS_STATUS_RESULT type back then pull the
data but ignore it.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
[email protected]                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.peppler.org/resume.html
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.