On 27 July 2016 at 18:09, Jin ZhiQiao (Joe) <[email protected]> wrote:

> When I use sqlite ado.net, I met a bug made me confused.
>
>
> My table schema and data is like this. Table name is "a".
>
> ID    TEXT   DOUBLE
>
> 1      AA      1
> 2      BB      1.2
> 3      CC      2
>
> When I run SQL statement("select * from a");
>
> I got double column's data is 1 1 2, and column dataType is
> system.Int64(Long)
> the 1.2 converted to 1. this make me got wrong value.
>
> But, if table is like this.
>
> ID    TEXT   DOUBLE
>
> 1      AA      1.3
> 2      BB      1.5
> 3      CC      2
>
> I got double column's data is 1.3 1.5 2, and column dataType is double
>

Hm, we had a similar report recently looking at an SQLite database via
Squirrel SQL (a JDBC based database browser). We have various types stored
in a column called 'value' (with no type qualifications), and if the first
row of a query had an INTEGER like value, TEXT data in subsequent rows
appeared as 0.

I presumed it was squirrel making an assumption along the lines of
"ResultSetMetaData.getColumnType() doesn't change between rows in the
result set", which I think would hold for other DB engines but obviously
not for SQLite. The same observation in .NET makes me wonder if there's a
more general problem, but my money is still on the DB abstraction
layer/SQLite adapter rather than SQLite itself...

-Rowan
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to