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: Monty Charlton <mcharlton at dtint dot com>
Subject: ct_fetch() with a stored proc.
Date: Jan 6 2002 4:25AM

Hello,

My stored proc. should return only one row of data, but ct_fetch() loops 
three times.  Plus, if I try to ct_cancel it, I get an error.  What could I 
possibly be doing wrong:

$ad_dbh4->ct_command( CS_RPC_CMD, "GetWebFieldsForAd", CS_NULLTERM, 
CS_NO_RECOMPILE );
$ad_dbh4->ct_param({    name => '@Adid',
                                datatype => CS_INT_TYPE,
                                status => CS_RETURN,
                                value => $storyid,
                                indicator => CS_UNUSED});
$ad_dbh4->ct_send();

while( $ad_dbh4->ct_results( my $handler ) == CS_SUCCEED )
{
                next unless $ad_dbh4->ct_fetchable( $handler );
                while( @webFieldsData = $ad_dbh4->ct_fetch() )
                {
                        # This prints three times.
                        print $webFieldsData[0], "\n";
                        push @webFields4x, [ @webFieldsData ];
                }
}

My stored proc is just a simple select.  Any ideas?

Thanks,
Monty

-- 
Monty Charlton
Digital Technology International