tags:

views:

41

answers:

1

I have an application in VB.NET which is generating some -301 errors in DB2 on an update statement using an ADO.NET connection.

It appears that DB2 reports the occurrence of this error, but then fixes whatever data was wrong and resubmits. This fixing and resubmission comes with additional overhead and in turn real dollars and cents cost because this is mainframe DB2.

Is there a way to detect this -301 error in some way? I am not able to recreate the problem. I only know this is happening because DB2 reports that the error occurred, but because I am using a parameterized query and due to the configuration of DB2 I am not able to determine the values of the parameters.

At this point I think that my best bet is to serialize the inputs that I am getting and then write them out to xml and when my DBA is able to tell me when an error occurs, I will take the file and then reprocess in a test environment one by one. That is, unless there is something which I can check, like a return code, and then send an error email with a serialization of the offending object instance.

A: 

Hi Anthony Potts

That DB2 fixes and resubmits the statement sounds very odd!
Perhaps there is some extra layer between your program and DB2 that does that?

Well, when you don't get the error returned to your program then ...
First you could ask your DBA to send you the error with the position-number and the update-statement so you can see which host-variable is the problem.
The variable is probably used in some SQL-function. Your DBA should be able to say which datatypes are allowed there.

Here a link to e description of the error (if you don't have it): http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.codes/n301.htm

My answer is not quite what you asked for but I don't think it can be any closer.

Regards
    Sigersted

Sigersted