I have three records in table with roll numbers 1,2,3.
I want to delete the records from the table using C#.
I am getting the error-Code:protected void Button1_Click(object sender, EventArgs e) { string sRollNos=""; for (int i = 1; i <= 3; i++) { if (sRollNos == "") { sRollNos = i.ToString (); } else sRollNos = sRollNos + "," + i; } OracleCommand cmd = new OracleCommand("USP_DEL_TBL_STUDENT_DATA", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@p_ROLL",sRollNos ); if (con.State == ConnectionState.Closed) { con.Open(); } cmd.ExecuteNonQuery(); }
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 1.
Roll column datatype is Number.
Stored Procedure-
Can somebody help me out!!!Code:create or replace PROCEDURE "USP_DEL_TBL_STUDENT_DATA" ( p_ROLL IN TBL_STUDENT.ROLL%TYPE ) AS BEGIN DELETE FROM TBL_STUDENT where roll in (p_roll); end;




Reply With Quote