PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Wechsler, Steven" <SWechsler at espeed dot com>
Subject: RE: return status in last ct_fetch
Date: Feb 11 2004 4:06PM

Sorry, should have been more specific.

I'm using ct_fetch in an array context, exactly as in your example below.
The last ct_fetch (i.e. before an undef is returned) returns a 0 in the
first column (probably the only column; haven't checked too carefully).

ISTR bringing this issue up several years ago on the the Sybperl list, but
don't remember the outcome.

Steve
-----Original Message-----
From: Michael Peppler [mailto:mpeppler@peppler.org]

On Wed, 2004-02-11 at 07:20, Wechsler, Steven wrote:
> Is there an easy fix for this? The last retrieval from ct_fetch always
gives
> me a 0.

How do you mean that it gives you a 0?

A normal fetch loop goes like this:

while(@data = $dbh->ct_fetch) {
   ...
}
This exits when ct_fetch returns either an undef or a zero length array.
Are you perhaps using "@data" in a scalar context?

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                 http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions - http://www.peppler.org/resume.html



CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of eSpeed, Inc.
     E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.  If verification is required please request a hard-copy version.
     Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). 

For further important information, please see http://www.espeed.com/full-disclaimer.html