我在 PLSQL 规范中声明了一个集合表和记录。
type loan_recov_rec is record(v_prncpl_ed_cd number(3),v_prncpl_recov number (7),v_int_ed_cd number(3), v_int_recov,number(5)); type loan_recov_tbl is table of loan_recov_rec index by binary_integer;
程序 pr_final_settlement(loan_recov_tbl 中的 v_loan_recov_tbl);
所以,我从 C# 页面传递 Array 参数
cmd.ArrayBindCount = v_loan_recov_tbl.Length;
Oracle.DataAccess.Client.OracleParameter P_loan_recov = new Oracle.DataAccess.Client.OracleParameter("v_loan_recov_tbl", Oracle.DataAccess.Client.OracleDbType.Int32);
P_loan_recov.Direction = ParameterDirection.Input;
P_loan_recov.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray;
P_loan_recov.Value = v_loan_recov_tbl;
cmd.Parameters.Add(P_loan_recov);
使用上面的代码它不起作用它得到错误Unable to cast object of type 'System.Int32' to type 'System.Array'. v_loan_recov_tbl is an Array Parameter.
听,我正在使用数据类型OracleDbType.Int32
是正确的,或者我必须删除其他数据类型。我在过程中将输入参数声明为表