Forum Discussion

AGo's avatar
AGo
Post Patron
4 years ago
Solved

Regional setting for decimal in Odbc.DataSource

Hello,

I'm using Odbc.DataSource() to query a PostgreSQL database, every decimal field is returned without decimal (as an integer), it's easy form me to apply a division by 100, but now I'm querying a lot of fields really. Is there a way maybe to pass a regional parameter/argument to this function to have my values with decimal or the problem could be in the ODBC configuration?

 

Thanks in advance

  • Hi AGo ,

    Could not reproduce it in my side as far as my test. 

    Test Environment: 

    PostgreSQL 13 Database; ODBC Driver: postgresql_13_002.zip

     

    You can try to set the data type as numeric in PostgreSQL which is equal to decimal, refer: 8.1. Numeric Types 

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi AGo ,

    Could not reproduce it in my side as far as my test. 

    Test Environment: 

    PostgreSQL 13 Database; ODBC Driver: postgresql_13_002.zip

     

    You can try to set the data type as numeric in PostgreSQL which is equal to decimal, refer: 8.1. Numeric Types 

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi @AGo ,

    Could not reproduce it in my side as far as my test. 

    Test Environment: 

    PostgreSQL 13 Database; ODBC Driver: postgresql_13_002.zip

    1.png

     

    You can try to set the data type as numeric in PostgreSQL which is equal to decimal, refer: 8.1. Numeric Types 

    vyingjl_0-1636424752933.png

    vyingjl_1-1636424776180.png

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.