E-Mail:
Author Avatar

SQL0113N DB2Exception when accessing DB2 from .NET

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.

What Do You Think?

 


Anti-Spam Image

Want to Start a Blog Here for Free?

Are you an expert in one subject or another? If your goal is to help others and dispense hard-earned information back to the community, stake a claim on your very own Lockergnome blog today! You can write about anything - no matter the topic. Sign-up to start blogging!

Author Avatar
Uncategorized - Dec 31, 2007

What Should Load with Vista?

Author Avatar
Uncategorized - Dec 31, 2007

Server Rack Installed in Home Computer Lab

Author Avatar
Uncategorized - Dec 8, 2007

Review of the Nerf Maverick from ThinkGeek