We have an ASP.NET web service that invokes a stored procedure on our DB (Oracle 11g). The problem is that the call to the procedure blows up every time an empty string is pass
You can do the following for any nullable parameters.
oleDBCmd.Parameters.Add(new OracleParameter("to_dt", OracleType.NVarChar));
if(string.IsNullOrEmpty(toDateStr)) {
oleDBCmd.Parameters["to_dt"].Value = DBNull.Value;
} else {
oleDBCmd.Parameters["to_dt"].Value = toDateStr;
}
oleDBCmd.Parameters["to_dt"].Direction = ParameterDirection.Input;
That way, you're not relying on string -> null conversion by the oracle adapter.
Edit: If this doesn't fix the issue, it is most possibly a mismatch between types, check NVarChar vs VarChar