Re: [sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Zbigniew
2012/4/12, Alexey Pechnikov :

> May be used "onecolumn" function instead of "eval". The "eval" function
> returns empty value of single record and so the result is "{}".

"Empty list", I suppose?
-- 
regards,
Zbigniew
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Zbigniew
2012/4/12, Richard Hipp :

> On Thu, Apr 12, 2012 at 2:06 PM, Zbigniew  wrote:
>
>> At the attempt to get a non-existing value, for example:
>>
>> set x [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>>
>
> The correct way to do this would be one or other other of the following:
>
>set x [lindex [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>
>set x [dbcomm onecolumn eval {SELECT max(somecolumn) FROM sometable}]
>
> In the second example, it is traditional to abbreviate "onecolumn" to
> simply "one".

Thanks, "onecolumn" work for me. Do you mean, that "eval" will always
return a list, although my SELECT clause wants just single value?
-- 
regards,
Zbigniew
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Richard Hipp
On Thu, Apr 12, 2012 at 2:15 PM, Richard Hipp  wrote:

>
>
> On Thu, Apr 12, 2012 at 2:06 PM, Zbigniew  wrote:
>
>> At the attempt to get a non-existing value, for example:
>>
>> set x [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>>
>
> The correct way to do this would be one or other other of the following:
>
>set x [lindex [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>

Oops.  Omitted the " 0]" from the end of the previous line -^


>
>set x [dbcomm onecolumn eval {SELECT max(somecolumn) FROM sometable}]
>
> In the second example, it is traditional to abbreviate "onecolumn" to
> simply "one".
>
>
>>
>> The returned value of $x will be {} - and no, not "empty", but exactly
>> these two characters.
>>
>> Easy to reproduce.
>> --
>> Zbigniew
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Richard Hipp
On Thu, Apr 12, 2012 at 2:06 PM, Zbigniew  wrote:

> At the attempt to get a non-existing value, for example:
>
> set x [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>

The correct way to do this would be one or other other of the following:

   set x [lindex [dbcomm eval {SELECT max(somecolumn) FROM sometable}]

   set x [dbcomm onecolumn eval {SELECT max(somecolumn) FROM sometable}]

In the second example, it is traditional to abbreviate "onecolumn" to
simply "one".


>
> The returned value of $x will be {} - and no, not "empty", but exactly
> these two characters.
>
> Easy to reproduce.
> --
> Zbigniew
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Alexey Pechnikov
May be used "onecolumn" function instead of "eval". The "eval" function
returns empty value of single record and so the result is "{}".

2012/4/12 Zbigniew 

> At the attempt to get a non-existing value, for example:
>
> set x [dbcomm eval {SELECT max(somecolumn) FROM sometable}]
>
> The returned value of $x will be {} - and no, not "empty", but exactly
> these two characters.
>
> Easy to reproduce.
> --
> Zbigniew
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug in SQLite's TCL module

2012-04-12 Thread Zbigniew
At the attempt to get a non-existing value, for example:

set x [dbcomm eval {SELECT max(somecolumn) FROM sometable}]

The returned value of $x will be {} - and no, not "empty", but exactly
these two characters.

Easy to reproduce.
-- 
Zbigniew
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users