On Wed, Feb 24, 2010 at 5:22 PM, eternelmangekyosharingan
<eternelmangekyosharin...@gmail.com> wrote:
> Hello all,
>
> I create the following table:
> sqlite> create table t1(a);
> sqlite> insert into t1 values(123456789.123456789);
>
> I ran the following commands:
> sqlite> select * from t1;
> 123456789.123457
> sqlite> select typeof(a) from t1;
> real
>
> What I expected to get is:
> sqlite> select * from t1;
> 123456789.123456789
> sqlite> select typeof(a) from t1;
> text
>
> since the conversion of 123456789.123456789 to real induce some loss.
>
>
> Can someone help me out to understand the dynamic typing of sqlite ?
>


sqlite> create table t1(a);
sqlite> insert into t1 values ('123456789.123456789');
sqlite> select * from t1;
a
-------------------
123456789.123456789
sqlite> select typeof(a) from t1;
typeof(a)
----------
text
sqlite> insert into t1 values (123456789.123456789);
sqlite> select * from t1;
a
-------------------
123456789.123456789
123456789.123457
sqlite> select typeof(a) from t1;
typeof(a)
----------
text
real
sqlite>



-- 
Puneet Kishor
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to