Menu

#1497 Cannot enter a number with more than 10 digits when editing a table content.

SQuirreL
open
nobody
None
high
2022-02-20
2022-02-14
No

SQuirreL SQL 4.3.0 with sqlite database cannot edit numeric fields with more than 10 digits.
It shows a DECIMAL_DIGITS column with value 10 in the tab columns (when a table is selected in the tab objects). When I try to enter a value for a numeric field in the tab content, I get a java.lang.NumberFormatException for input string 12345678901 (cannot input more than 10 digits and in the global properties dialog there is no field for maximum number of digits)

Discussion

  • Cristian Baboi

    Cristian Baboi - 2022-02-14

    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.

     
  • Gerd Wagner

    Gerd Wagner - 2022-02-19

    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.

     
  • Cristian Baboi

    Cristian Baboi - 2022-02-20

    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
  • Cristian Baboi

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.