SQL0113N DB2Exception when accessing DB2 from .NET
- 0
- Add a Comment
Just a quick tip for the Googlers out there who find themselves with as empty a search page as I was. If you’re developing a .NET application using a 3rd-party library to access a DB2 database, sucks to be you.
Anyway, when calling a stored procedure on the DB2 server, you may get a DB2Exception reading “SQL0113N: Invalid character found in [sproc], reason code : 000″. All the Googling in the world will reveal that this is usually a malformed data string in one of your input parameters, or an erroneously-cased parameter name.
This is not always the case. As I recently learned, when calling a sproc in DB2, you must declare the entire DB2Command string in uppercase, like so:
Dim con as new DB2Connection(ConnectionString)
Dim cmd as new DB2Command(”DATABASE.SPROCNAME”,Con)
Lowercase won’t work. Smart casing won’t work. Casing it the way the DB2 guy gave it to you won’t work. Pass it in all caps, including the database name. That is all.
