Cannot enter a number with more than 10 digits when editing a table content.
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
After I set in the global preferences a large value for max decimal digits (which was set to 5), I was able to enter more than 10 digits even after I set the max decimal digits to 4. After that the number began to be displayed with "," separators. So I think there is an initialization bug somewhere.
Fixed in our GIT repository, will be available in future snapshots and versions.
Excerpt from change log:
'#1497 When table-editing columns of type NUMERIC OR DECIMAL SQuirreL tried to validate if the edited number's
scale and precision match the column definition. This was dropped.
SQuirreL now lets the database decide if the edited value can be stored.
As a side note:
With SQLite version 3.36.0.3 one can define a NUMERIC column with scale larger than 5 (in my example NUMERIC(12,12)) . However the method java.sql.ResultSet.getBigDecimal(...) returns a value of at most scale 5.
The thing is the column was declared NUMERIC(20,0). and it didn't work.
Also the numeric formatting was not applied (no comma or dot).
Only after I changed in the squirrel configuration the number of digits from 5 to something bigger, the formatting worked. I was trying to enter 64 bytes file sizes. I also stumbled on another bug. SELEC T max(col) FROM table return some strange numbers that are not in the table (col being a large number).
Last edit: Cristian Baboi 2022-02-20
My mistake. The DECIMAL(20,0) and INTEGER don't work. NUMERIC(20,0) works fine.
SELECT max(col) FROM table does not work because the resulting column is of type INTEGER.
DECIMAL(20,0) don't allow large integers and perform some approximation on large integers.
Also does not display the delimiters dot and comma in query results.