When calling a stored procedure using either ExecuteResultSet
or ExecuteReader
using (DB2Connection conn = new DB2Connection(connstr))
{
conn.Open();
DB2Command cmd = conn.CreateCommand();
cmd.Transaction = conn.BeginTransaction();
DB2Parameter db2param = new DB2Parameter("@ENTERPRISE_ID_PR091", DB2Type.Char, 15);
db2param.Direction = ParameterDirection.InputOutput;
db2param.Value = enterpriseID.ToCharArray();
cmd.Parameters.Add(db2param);
//... many parameters
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "XXISCHMA.XXIPW09D";
DB2ResultSet dr = cmd.ExecuteResultSet(DB2ResultSetOptions.Scrollable);
}
In Web API the Exceptionis thrown:
SQL0035N The file "C:\Users\documents\visual studio 2013\Projects\App\Web\msg\en_US\db2nmp.xml" cannot be opened
In other Applications an Exception is thrown:
ERROR [22023] [IBM][DB2] SQL0310N SQL statement contains too many host variables.
I don't think the exception texts are correct...
Is this by design?
In COBOL the SQL code of -310 is returned, which is "DECIMAL HOST VARIABLE OR PARAMETER number CONTAINS NON-DECIMAL DATA".