Resolving the Oracle ODAC .NET error message „Attempted to divide by zero“

Issue

If you are executing a simple SQL query like

SELECT * FROM Articles

against an Oracle database from within a .NET application and you are getting an exception like

System.DivideByZeroException: Attempted to divide by zero.

In German:

System.DivideByZeroException: Es wurde versucht, durch 0 (null) zu teilen.

Cause

Probably a bug in the ODAC .NET drivers/layers. One user in the Oracle forums faced the same issue.

Resolution

In my case it was as simple as replacing the asterisk („*“) with an explicit list of columns I wanted to query for.

E.g.

SELECT Name1, Price, Description FROM Articles

After that modification, I was successfully able to run the query and get results.

Ein Gedanke zu „Resolving the Oracle ODAC .NET error message „Attempted to divide by zero“

Schreibe einen Kommentar zu suneel Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Seite verwendet Akismet, um Spam zu reduzieren. Erfahre, wie deine Kommentardaten verarbeitet werden..