I'm trying to do something which should be fairly simple, but in my experience with Oracle, nothing ever is...!
I'm trying to call an oracle procedure in C# using MS provider for Oracle. As far as I can tell, there are the correct number of parameters, and the type of each parameter is correct. More importantly, if I run the procedure from within Oracle SQL Developer, the values I'm supplying to Oracle work OK.
In the following example code, I've tried supplying DBNull.Value for each parameter, in the hope that I can get it complete the call. Even a 'null values not allowed' type error would be an improvement! But you can see the commented-out values that I was originally supplying.
param = cmd.Parameters.Add(new OracleParameter("cpy_contact_", OracleType.VarChar, 80));
param.Value = DBNull.Value; // firstName + " " + lastName;
param = cmd.Parameters.Add(new OracleParameter("cpy_opptype_", OracleType.Number));
param.Value = DBNull.Value; // Decimal.Parse(opportunityType);
param = cmd.Parameters.Add(new OracleParameter("cpy_orderdate_", OracleType.DateTime));
param.Value = DBNull.Value; // String.Format("{0:dd-MMM-yy}",DateTime.Now);
param = cmd.Parameters.Add(new OracleParameter("cpy_discount_", OracleType.VarChar, 80));
param.Value = DBNull.Value; // discount.ToString();
param = cmd.Parameters.Add(new OracleParameter("cpy_enquiryno_", OracleType.VarChar, 80));
param.Value = DBNull.Value; // "WEB" + enquiryNo;
param = cmd.Parameters.Add(new OracleParameter("parent_guid_", OracleType.VarChar, 32));
param.Value = DBNull.Value; // companyGUID;
param = cmd.Parameters.Add(new OracleParameter("guid_", OracleType.VarChar, 32));
param.Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();