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: Re: ct_fetch() with a stored proc.
Date: Jan 6 2002 4:59AM

All,

Well, it seems I hit the send button a wee bit too fast....

I put
$ad_dbh4->ct_cancel( CS_CANCEL_ALL );
just after the while loop and everything did what I wanted it to.  Seems 
strange to have to run ct_cancel as a normal practice.  Not that I care, mind 
you.  It works great, so I'm perfectly happy.  :)

Monty

On Saturday 05 January 2002 09:25 pm, you wrote:
> 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