> Yes, but I can not affect column type ... FreePascal SQLite3 connector must
> be able to work with any user database.

If your goal is to work with any user database created outside of your
FreePascal connector then chances are that user will use the same
database outside of your FreePascal connector too. And if use declared
column as NUMERIC then he probably will expect numbers to be inserted
into that column (especially if the data type inside FreePascal is
also some sort of number). User also will probably execute some
queries that do some arithmetic operations on values in that column.
And they will be really surprised to see that not all the data is
numbers there.

So you better insert everything as numbers, let SQLite transform
everything to REAL and lose precision. And tell your users that it's
limitation of SQLite and you cannot do anything with it, only suggest
to insert big numbers as text.


Pavel

On Wed, Mar 23, 2011 at 9:06 AM, LacaK <la...@users.sourceforge.net> wrote:
>> And...no conversion is performed if you declare the field as text and
>> insert as text.
>
> Yes, but I can not affect column type ... FreePascal SQLite3 connector must
> be able to work with any user database.
>
> And when user defines column like NUMERIC or DECIMAL ... so with NUMERIC
> column affinity,
> then it does not help when I write/bind numbers like TEXT
> (sqlite3_bind_text) '123456789123456789.123456789'
> because SQLite ALWAYS convert such "text number" to native floating-point or
> integer number, which leads to lost of precision.
>
> So probably before bind I will test if number of significant digits > 15
> then I will use sqlite3_bind_blob else sqlite3_bind_double
>
> -Laco.
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to