I am trying to figure out Oracle stored procedure as I am new to Oracle 11G
Here is my MS SQL stored procedure
Create procedure LoadLoginData
@username varchar(50),
@password varchar(50)
as
begin
select * from Employee_table where
username = @username and password = @password
end
When I used Oracle Scratch Editor I get this output
CREATE OR REPLACE PROCEDURE LoadLoginData
(
v_username IN VARCHAR2 DEFAULT NULL ,
v_password IN VARCHAR2 DEFAULT NULL ,
cv_1 OUT SYS_REFCURSOR
)
AS
BEGIN
OPEN cv_1 FOR
SELECT *
FROM employee_table
WHERE Username = v_username
AND PASSWORD = v_password ;
END;
when I call the Oracle procedure in C# it throws this exception
"ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'LOADLOGINDATA' ORA-06550: line 1, column 7:"
Any idea how to figure this out?
My C# code
OracleConnection ocon = new OracleConnection(orastr);
OracleCommand ocmd = new OracleCommand("LoadLoginData", ocon);
ocmd.CommandType = CommandType.StoredProcedure;
ocon.Open();
try
{
ocmd.Parameters.Add("Username", nBo.username);
ocmd.Parameters.Add("Password", nBo.password);
OracleDataAdapter oda = new OracleDataAdapter(ocmd);
DataSet ds = new DataSet();
oda.Fill(ds);
DataTable dt = ds.Tables[0];
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
ocon.Dispose();
ocon.Close();
nBo = null;
}