IBM Support

Decimal invalid operation error occurs when a SELECT SQL query against a Virtual Table containing DECIMAL datatype column is executed

Troubleshooting


Problem

When a SELECT SQL query against a Virtual Table which has a DECIMAL datatype column is executed using pyodbc version 4.0.17 then an error “decimal invalid operation” occurs.

Symptom

Virtual Table has a column SMF74DTE with DECIMAL datatype as shown below.

image-20230518201946-1

When a SELECT SQL query is executed then it gave "decimal invalid operation" error for DECIMAL datatype column (SMF74DTE).

>>> cursor.execute("SELECT SMF74DTE FROM SMF_07404__IFASMF_SMF70T79_JA0_INMEM LIMIT 100")
<pyodbc.Cursor object at 0x3ffb42ad090>
>>> for row in cursor:
...   print(row)
...

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]


Document Location

Worldwide


[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS4NKG","label":"IBM Data Virtualization Manager for z\/OS"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSKRKK","label":"IBM Db2 Analytics Accelerator Loader for z\/OS"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS3H8V","label":"IBM Open Data Analytics for z\/OS"},"ARM Category":[{"code":"a8m0z000000cxHeAAI","label":"IBM z\/OS Mainframe Data Service for Apache Spark"}],"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"1.2.0","Line of Business":{"code":"LOB70","label":"Z TPS"}},{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS6QWT","label":"IBM QMF Analytics for Multiplatforms"},"ARM Category":[{"code":"a8m0z000000cxH0AAI","label":"QMF Data Service"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

To view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use the link to actual document below to access the full document. You will be asked to log on if you are not already logged in. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
IBM Data Virtualization Manager for z/OS

Software version:
All Versions

Operating system(s):
z/OS

Document number:
6988123

Modified date:
02 June 2023

UID

ibm16988123

Manage My Notification Subscriptions