|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: syb_more_results is 0 when I expect it to be 1
Date: Jun 2 2004 4:10PM
On Wed, 2004-06-02 at 18:01, ndronen@technolalia.com wrote:
> Hi, all:
>
> I'm pretty sure I'm just doing something dumb here. I'm expecting
> multiple result sets back from a stored procedure but $sth->{syb_more_results}
> is 0 when I'd expect it to be 1.
> $sth->execute();
>
> do {
> my $row = $sth->fetchrow_arrayref();
> print Dumper $row;
> } while ($sth->{syb_more_results});
You need to call fetchrow_arrayref() in a loop until it returns false.
In the code above you test syb_more_results before you've finished
processing the first result set, and it's therefore false.
Whether this behavior is correct is possibly debatable (i.e. maybe it
syb_more_results should return true if there are unfetched data)
Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler@peppler.org 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
|