Forum Stats

  • 3,758,927 Users
  • 2,251,475 Discussions
  • 7,870,438 Comments

Discussions

How to get the same value of NUMBER type in Oracle db when cursor.fetchall() is called

User_4YI8U
User_4YI8U Member Posts: 2 Green Ribbon

Hi,

In my Oracle 19c database, I have a table with many columns of type NUMBER and they store the values like for example 100, 0, 250 etc. However, when SQL Query is executed using cx_Oracle python module (v8.2.1), the cursor.fetchall() method is returning the values of those NUMBER type columns as 100.0, 0.0, 250.0 (with single decimal point). As a result our automation test results comparison is failing.

Could you please suggest/guide me on how to get the exact value of those NUMBER type columns in the same way how Oracle db stored without that additional decimal value (dot zero). Please let me know if you need any additional information on the issue.


Regards,

Chandrasekhar

Answers