Skip to Content.
Sympa Menu

freetds - RE: [freetds] SELECT '' and TDS 7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'freetds AT lists.ibiblio.org'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] SELECT '' and TDS 7.0
  • Date: Mon, 27 Jan 2003 16:08:53 +0100

>
> All,
>
> I've done the following test, using latest snapshot freetds + sqsh 1.7
> (ct-library), TDSVER set to 70 accessing SQL 2000
>
> 1> create table bill_null_test(col1 int not null, col2 int null, col3
> char(4) null)
> 2>
> 3> go
> 1> insert bill values ( 1, null, null)
> 2> go
> 1> select col1, col2, col3, '' isitnull from bill_null_test
> 2> go
> col1 col2 col3 isitnull
> ----------- ----------- ---- --------
> 1 NULL NULL
>
> doesn't this prove that a null value prints as 'NULL' whereas
> select ''
> prints as spaces ?
>
> Bill
>

??

Problem is difference from an empty string and NULL. In TDS 4.2 when you
issue a "SELECT ''" a single space is returned (' '). This cause a NULL
string is represented as a empty string. TDS7 remove this limit allowing
empty string (NULL is now a string of length -1, not 0).
I don't remember if this was fixed in 0.60 or later...

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page