Sybase weirdness

jplindstrom on 2003-06-03T22:22:20

There is this annyoing weirdness in Sybase. Better to have it read by people and spidered by Google than not, so here it is.

If you, in a stored procedure, have an output parameter of type bit and it doesn't have a value (it may be passed in with a NULL value) when the procedure returns, the ct-lib on the client will crash due to faulty TDS data.

This can happen if e.g. a foreign key constraint is violated and an error is raised before you touch the variable.

The solution is to make sure the variable always has a proper bit-like value, so put

select @is_weird = 1

at the beginning of the procedure before anyhing can go wrong.


version

inkdroid on 2003-06-03T22:49:29

So what's the Sybase version? Just in case someone comes here from Google sometime...

re: version

jplindstrom on 2003-06-04T19:47:25

ASE 12.5 + the 12.5 Open Client (Windows). Open Client is of course installed on top of the 11.9.2 version since they stopped shipping SQL Advantage and a proper Sybase Central way back.