我正在使用Oracle数据库开发ASP.net应用程序。当我尝试将数据插入表REGISTER时,它会抛出一个异常,如下所示
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INSERTREGISTER'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
表注册将USERNAME,PASSWORD,EMAIL作为列
存储过程INSERTREGISTER如下
create or replace
PROCEDURE INSERTREGISTER IS
u1 varchar2(20);
p1 varchar2(20);
e1 varchar2(20);
BEGIN
INSERT INTO REGISTER (USERNAME, PASSWORD, EMAIL) VALUES (u1, p1, e1);
END INSERTREGISTER;
我的c#代码是:
public int Insert(string u1, string p1, string e1)
{
try
{
OracleCommand cmd = new OracleCommand("INSERTREGISTER", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OracleParameter("u1", OracleType.VarChar)).Value = u1;
cmd.Parameters.Add(new OracleParameter("p1", OracleType.VarChar)).Value = p1;
cmd.Parameters.Add(new OracleParameter("e1", OracleType.VarChar)).Value = e1;
conn.Open();
cmd.ExecuteNonQuery();
return cmd.ExecuteNonQuery();
}
请帮助我
的问候, 阿琼
答案 0 :(得分:1)
将您的程序更改为
create or replace
PROCEDURE INSERTREGISTER (u1 varchar2,p1 varchar2,e1 varchar2) AS
BEGIN
--your sql statement
END