Skip to Content.
Sympa Menu

freetds - Re: dblib problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Mark J. Lilback" <mark AT lilback.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: dblib problem
  • Date: Thu, 4 Apr 2002 16:28:36 -0500


Most APIs I've worked with function this way (I know I've seen ODBC drivers that don't clear them, and I think Oracle doesn't either). You're suppose to bind an indicator variable that you check for a NULL in before looking at the real value (or you can set the variables to zero/null).

A NULL value is not zero, but distinct from it. So setting it to zero really isn't the correct thing to do. It might be convenient, but it could easily lead to incorrect code because you aren't checking the indicator variables.

Since this is incompatible with the Sybase implementation, it might need fixing to maintain compatibility. But if NULL values are allowed, you reall should be checking the indicator variables.

Just my opinion, FWIW


At 1:36 PM -0700 4/4/02, Steven J. Backus wrote:
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. I could reset it
to zero on every pass, but there's a lot of these variables, and a
few programs. Besides, this seems to be broken so maybe we should
fix it. As usual, TIA and all that.


--
__________________________________________________________________________
"They that can give up essential liberty
Mark J. Lilback to obtain a little temporary safety
<mark AT lilback.com> deserve neither liberty or safety."
http://www.lilback.com/ -- Benjamin Franklin




Archive powered by MHonArc 2.6.24.

Top of Page