/// <summary> /// Adds a parameter to the Oracle command passed as parameter. /// </summary> /// <param name="command">The command to be used.</param> /// <param name="parameter">The parameter to be passed.</param> public static void AddCommandParameter(OracleCommand command, QueryParameter parameter) { if (null != parameter) { if (parameter.IsInput()) { if (null != parameter.Value) { if (parameter.DbSize > 0) { command.Parameters.Add(parameter.Name, DbTypeToOracleDbType(parameter.DbType), parameter.DbSize).Value = parameter.Value; } else { command.Parameters.Add(parameter.Name, parameter.Value); } } else { command.Parameters.Add(parameter.Name, DBNull.Value); } } else if (parameter.IsInputOutput() || parameter.IsOutput()) { if (parameter.DbType == Database.DbType.DECIMAL) { command.Parameters.Add(parameter.Name, DbTypeToOracleDbType(parameter.DbType), parameter.Direction).Precision = (byte)parameter.DbSize; } else { command.Parameters.Add(parameter.Name, DbTypeToOracleDbType(parameter.DbType), parameter.DbSize).Direction = parameter.Direction; } } } }