Skip to Content.
Sympa Menu

freetds - RE: dblib problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: dblib problem
  • Date: Thu, 4 Apr 2002 17:24:31 -0500


> The actual value of spanish in the database is NULL, and when I use
> the standard dblib that came with sybase, my spanish is set to
> zero. Now, you might say "why not just initialize spanish to 0?"
> But this problem is more dramatic. Whenever spanish is NULL, the
> value is not set. So say spanish was 9, then the next dbnextrow
> it's NULL. Since it's not set, spanish stays 9.

Steven,

Sure looks broken. From the docs:

+++
Because null values can be returned from SQL Server, there is a set of
default values, one for each data type, that will be substituted when
binding null values. You can explicitly set your own values to be
substituted for the default null value with the dbsetnull function. (For
more information about a list of the default substitution values, see
dbsetnull.)
+++

Zero should be the default substitution for a null with INTBIND. There is
no "don't bother" substitution. Well, there isn't supposed to be. :-/

I'll have a look this weekend. Could you check two things?

1. If your query is reduced to "select cast(null as int) as A union
select 1 order by A desc", do you get the same behavior?

2. Does dbsetnull() do anything useful for you?

--jkl





Archive powered by MHonArc 2.6.24.

Top of Page