IBM Support

nzsql error, Unable to fathom update count

Question & Answer


Question

What does the message "Unable to fathom update count INSERT 0 5120000160" mean?

Answer

If you run a INSERT, UPDATE, CREATE AS SELECT via JDBC and the number of rows INSERTed, UPDATEd or CREATEd exceeds 2147483647, you will receive an error message similar to the following:

Unable to fathom update count INSERT 0 5120000160

The above error message may be different given whether an INSERT, UPDATE or CREATE as SELECT and given the number of rows actually affected.

This is a limitation of JDBC specification itself.

Everytime the query of type INSERT, UPDATE, CREATE AS SELECT is fired, the back end sends a status string which contains the number of rows that are affected due to the query fired.

JDBC driver stores this number as an update count. Whenever the application calls the method Statement.getUpdateCount() this number is returned.

According to JDBC specifications this number should be an integer. In JAVA the maximum value for an integer is '2147483647', so whenever the database server sends the number greater than this number, the JDBC driver fails to cast the number to an integer and throws an error saying 'Unable to fathom update count <status string>'.

However, it should be noted that the INSERT, UPDATE, CREATE AS SELECT did in fact correctly affect all affected rows for the given table. The only error is that JDBC was not capable of displaying the number of rows affected.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ551026

Document Information

Modified date:
17 October 2019

UID

swg21567874