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: Michael Peppler <mpeppler at peppler dot org>
Subject: Sorry about the first mail
Date: Mar 23 1999 6:10PM

Andrew J Davies writes:
 > 
 > Hi All
 > This code works fine up to a point.!
 > BUT, It returns the return status of the strored proc (0).
 > Is there an easy way to eliminate this ?

YOu need to check the $restype value.

If it's CS_STATUS_RESULT then you're getting the status result from
the server.

So you can do something like this (not necessarily optimal, but you
get the idea...):


      while ( $rc = ( $dbh->ct_results($restype)) == CS_SUCCEED)
           {
                next if (  !  $dbh->ct_fetchable($restype)   );

		if ($restype == CS_STATUS_RESULT) {
			my ($status) = $dbh->ct_fetch;
			if ($status) {
				die "Arggg....!!! - got $status status\n";
			}
			while(my $d = $dbh->ct_fetch(0,1)) {
				;
			}
			next;
		}
 
                while ( %cust = $dbh->ct_fetch(1) )
                {
                          write CUST_HANDLE;
                }
           }

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com