我需要通過C#用戶定義的對象:套印C#用戶定義的對象到PL/SQL函數作爲參數
[DataContract]
public class SEmployeeIncome
{
[DataMember]
[OracleObjectMappingAttribute("CARDID")]
public string CardId { get; set; }
[DataMember]
[OracleObjectMappingAttribute("INCOMETIME")]
public string IncomeTime { get; set; }
}
作爲列表PL/SQL函數但Oracle返回這樣的誤差: {「無效參數結合\ r \ n參數名:p_employees_income「}
我這是怎麼傳遞的對象列表作爲參數:
var oracleParam = new OracleParameter();
oracleParam.OracleDbType = OracleDbType.Array;
oracleParam.Direction = ParameterDirection.Input;
oracleParam.ParameterName = "p_employees_income";
oracleParam.Size = entity.EmployeesIncome.Count();
oracleParam.Value = entity.EmployeesIncome.ToArray() ;//SEmployeeIncome list
oracleCommand.Parameters.Add(oracleParam);
和pl/sql函數定義爲:
Function search_delayed_employees (p_employees_income employee_income)
return ics_types.result_cursor ;
它看起來像你正試圖傳遞一個數組到一個pl/sql函數參數接受一個單一的。嘗試傳遞'ToArray()。First()'來查看它是否接受 –