Skip to content

Conversation

@sushil97
Copy link

@sushil97 sushil97 commented Sep 12, 2018

@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 sushil97 changed the title Updating DBTablePrinter.java Corrected Parsing Problem Sep 12, 2018
@htorun
Copy link
Owner

htorun commented Sep 12, 2018

Looks good. Thanks a lot. Merging it now.

@htorun
Copy link
Owner

htorun commented Sep 12, 2018

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 :) )

@sushil97
Copy link
Author

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

@jmaness
Copy link

jmaness commented Nov 10, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants