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: Re: Sybase::Simple not getting stored proc return status
Date: Apr 30 2004 5:22PM

On Fri, 2004-04-30 at 18:04, Michael Peppler wrote:
> On Fri, 2004-04-30 at 17:54, Graham Hick wrote:
> 
> > 
> > This is a change in behaviour compared to earlier versions (0.51 in
> > particular).  In 0.51, Scalar will return the stored proc return status,
> > unless the proc creates any result sets of its own.  In 0.56, Scalar
> > returns undef unless the proc creates its own result set.
> 
> Sorry about that.
> 
> I *think* that if you change the last line of the Scalar() subroutine
> from 
> 	$data[0];
> to
> 	$data[0] || $status;
> 
> you should get the desired behavior.

At second thought this fix is a little lacking. It fails to return the
correct value in the case where the stored proc runs a SELECT that
returns a NULL or a numeric value that evaluates to 0 as the first
column of the first row. I'll look at making a better fix for
Sybase::Simple next week.

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