I’m getting this error in ASP.NET application (whereas it works fine in Oracle)
PLS-00703::multiple instances of named argument in list
I’ve attached the code here. It shows error in the last line i.e. cmd.ExecuteNonQuery()
cmd.Parameters.AddWithValue("in_prog_id", 2);
cmd.Parameters.AddWithValue("in_sllr_co_id", 1);
cmd.Parameters.AddWithValue("in_sllr_purch_loc_nbr", 1);
cmd.Parameters.AddWithValue("in_byr_co_id", Convert.ToInt32(co_id));
cmd.Parameters.AddWithValue("in_byr_purch_loc_nbr", purch_loc_nbr);
cmd.Parameters.AddWithValue("in_ing_id", ing_id);
cmd.Parameters.AddWithValue("in_per_id", per_id);
cmd.Parameters.AddWithValue("in_ing_purch_qty", "12");
cmd.Parameters.AddWithValue("in_pop_sl_trck_nbr", "ECAP");
cmd.Parameters.AddWithValue("in_pop_sl_cmnt_txt", dstemp.Tables["ECAP"].Rows[i][6].ToString());
cmd.Parameters.AddWithValue("in_chg_by", 1333);
cmd.Parameters.AddWithValue("in_ing_rev_amt", dstemp.Tables["ECAP"].Rows[i][5].ToString());
cmd.Parameters.AddWithValue("in_sl_typ", "ME");
cmd.Parameters.AddWithValue("in_dir_sale_ind", "DIR-SL");
cmd.Parameters.AddWithValue("in_intg_sl_ind", "N"); ***//character as input***
cmd.ExecuteNonQuery();
This is my method inside which the above statements hold in.
private void call_proc(int i, DataSet dstemp, OracleCommand cmd)
{
}
and I invoke this method as follows:
cmd1 = conn3.CreateCommand();
cmd1.CommandText = "pkg_sale.cre_pop_sl";
cmd1.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < ds.Tables["ECAP"].Rows.Count; ++i)
call_proc(i, ds, cmd1);
Is there any problem in this?
This appears to be a common error with Oracle stored procedures and the most common cause is that the developer neglected to call
Parameters.Clearbefore repeated invocation of the code.Either that, or one or more of your parameters is being repeated someplace else.
Edit (after OP’s post)
It appears to be the first possibility because you are calling the function in a loop. Just Clear the parameters within the looped function and it should work.
See this reference