Possible bug

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible bug

Tenkawa
Is this a bug or something I'm missing with the logical handling of ''
versus ""

version 2.8.16 on Linux

schema

create table nicks (id integer primary key , nick TEXT, last integer(5));

Contents

sqlite> select * from nicks;
4|Her|99
5|Her|99
6|Her|99
7|Him|99
8|You|99


Query 1 (correct behavior)

sqlite> select id,nick,last from nicks where nick = 'Nick';
sqlite>

Query 2 (incorrect?)

sqlite> select id,nick,last from nicks where nick = "Nick";
4|Her|99
5|Her|99
6|Her|99
7|Him|99
8|You|99


Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Possible bug

Guillaume MAISON
Tenkawa a ?crit :

>
> Query 1 (correct behavior)
>
> sqlite> select id,nick,last from nicks where nick = 'Nick';
> sqlite>
>
> Query 2 (incorrect?)
>
> sqlite> select id,nick,last from nicks where nick = "Nick";
> 4|Her|99
> 5|Her|99
> 6|Her|99
> 7|Him|99
> 8|You|99

When dealing with STRING values, use only single quotes.

in your second case, it will consider Column(nick)=Column(Nick)
which are obviously the same :)

HTH,


--

Guillaume MAISON - N@uteus
83, Cours Victor Hugo
47000 AGEN
T?l : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [hidden email] - Web : http://nauteus.com

Reply | Threaded
Open this post in threaded view
|

Re: Possible bug

Tenkawa
Thanks. Thats what I thought but wanted to be sure.



On Fri, 11 Nov 2005, Guillaume MAISON wrote:

> Tenkawa a écrit :
>>
>> Query 1 (correct behavior)
>>
>> sqlite> select id,nick,last from nicks where nick = 'Nick';
>> sqlite>
>>
>> Query 2 (incorrect?)
>>
>> sqlite> select id,nick,last from nicks where nick = "Nick";
>> 4|Her|99
>> 5|Her|99
>> 6|Her|99
>> 7|Him|99
>> 8|You|99
>
> When dealing with STRING values, use only single quotes.
>
> in your second case, it will consider Column(nick)=Column(Nick)
> which are obviously the same :)
>
> HTH,
>
>
> --
>
> Guillaume MAISON - N@uteus
> 83, Cours Victor Hugo
> 47000 AGEN
> Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
> e-mail : [hidden email] - Web : http://nauteus.com
>
>