[freetds] intermittent empty results

Michael Peppler mpeppler at peppler.org
Tue Jun 29 01:52:54 EDT 2004


On Tue, 2004-06-29 at 02:12, James K. Lowden wrote:
> On Mon, 28 Jun 2004 14:53:53 EDT, Thompbil18 at aol.com wrote:
> > we have no way of knowing of course whether this is a valid return
> > status that you might want to retrieve or not, so we do what we do with
> > all return status messages - we "manufacture" a result set for the
> > return status, and inform ct-library that there is a return status to
> > fetch.
> 
> David, 
> 
> "perldoc DBD::Sybase" says:
> 
>        You can get the type of the current result set with
>        $sth->{syb_result_type}. This returns a numerical value,
>        as defined in $SYBASE/include/cspublic.h:
> 
>                #define CS_ROW_RESULT           (CS_INT)4040
>                #define CS_CURSOR_RESULT        (CS_INT)4041
>                #define CS_PARAM_RESULT         (CS_INT)4042
>                #define CS_STATUS_RESULT        (CS_INT)4043
>                #define CS_MSG_RESULT           (CS_INT)4044
>                #define CS_COMPUTE_RESULT       (CS_INT)4045
> 
>        In particular, the return status of a stored procedure is
>        returned as CS_STATUS_RESULT (4043), and is normally the
>        last result set that is returned in a stored proc execu-
>        tion.
> 
> The script in your original posting doesn't use syb_result_type.  It might
> be just what the doctor ordered.  Dr. Bill, that is.  

You can also add

	use DBD::Sybase;

to your script and use the symbolic values (CS_STATUS_RESULT).

And of course, run the script with DBI->trace(3) or higher to see which
API calls DBD::Sybase calls, and what results it receives.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler at 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





More information about the FreeTDS mailing list