dbtableprinter icon indicating copy to clipboard operation
dbtableprinter copied to clipboard

Corrected Parsing Problem

Open sushil97 opened this issue 7 years ago • 4 comments

@htorun Every thing works fantastic besides one thing. When there is a column of number datatype in SQL table, it creates some parsing problem. Please refer this image: before updation

I have tried to make necessary changes and now its working fine. Please review and let me know what you think! here is the screenshot of what result i got after changes i made after update

sushil97 avatar Sep 12 '18 03:09 sushil97

Looks good. Thanks a lot. Merging it now.

htorun avatar Sep 12 '18 15:09 htorun

Actually, I just realized that you included the NUMERIC data type under CATEGORY_INTEGER. Since NUMERIC is like DECIMAL and can store a decimal number, in order to be formatted correctly it should go under CATEGORY_DOUBLE. (I also realized that CATEGORY_DECIMAL or CATEGORY_REAL would be a better name for CATEGORY_DOUBLE :) )

htorun avatar Sep 12 '18 15:09 htorun

@htorun yes i also realized this after raising the pull request. I will work on it. And will commit changes to my branch asap. :)

sushil97 avatar Sep 17 '18 06:09 sushil97

I also encountered this problem on Oracle, and the fix I had was to also get the scale of the column from the ResultSetMetadata, store that on the Column, and change whichCategory to operate on a Column instead of just a int type since choosing the correct java.sql.Type requires more information (e.g. Type.NUMERIC can either be an Integer or Decimal depending on the scale)

jmaness avatar Nov 10 '19 14:11 jmaness