Re: [fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite

2011-04-01 Thread LacaK
Simply said: So Sqlite doesn't support real BCD values. Yes, SQLite does not support them native So we can't support it either for Sqlite. It was my question. We can (if we want) partialy add work-arounds: DECIMAL(x,y) if y=0 then map to ftLargeInt (64bit integer) elseif y=4 then map to

Re: [fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite

2011-04-01 Thread Joost van der Sluis
On Fri, 2011-04-01 at 11:13 +0200, LacaK wrote: Simply said: So Sqlite doesn't support real BCD values. Yes, SQLite does not support them native Then it's up to the 'user' (in our case the user is a programmer) to implement workarounds. If we add some work-around, nobody will know that that

Re: [fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite

2011-04-01 Thread LacaK
No, map to ftfmtbcd, as it should. That will work fine as long as the values are within the sqlite-range. ok. in reading phase no problem (ATM we read using sqlite3_column_text (so SQLite converts all storage classes (integer,real, blob) to string) and then converting to TBCD ... ok

Re: [fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite

2011-04-01 Thread Hans-Peter Diettrich
LacaK schrieb: So as long as users can't make tables with numeric fields that support more then 15 numbers, we don't have to support bcd-fields. So map decimal to BCD (not float, it will be invalid for values within the supported precision range). If users want to store numbers with an higher

Re: [fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite

2011-03-31 Thread Joost van der Sluis
On Thu, 2011-03-24 at 09:43 +0100, LacaK wrote: after doing some test with new implementation of TFmtBCDField for TSQLite3Connection connector I encounter this problem: When you declare in SQLite some column as NUMERIC or DECIMAL then this column will have NUMERIC affinity. CREATE TABLE t