首页 新闻 赞助 找找看

ADO.NET调用ORACLE 11g存储过程问题

0
[已关闭问题]

我用ADO.NET 调用存储过程会出现

( - + case mod new not null
   <an identifier> <a double-quoted delimited-identifier>
   <a bind variable> continue avg count current exists max min
   prior sql stddev sum variance execute forall merge time
   timestamp interval date
   <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe
   <一个带有字符集说明的可带引号的字符串文字>
   <一个可带引号的 SQL 字符串> purge
符号 "(在 ":" 继续之前已插入。

 

 

存储过程是:

create or replace procedure usp_SetRoleRight
(
   v_roleid in integer,
   v_modelid in integer,
   v_rightid in integer,
   v_enabled in integer
)
is
v_rowcount int;
begin
    select count(*) into v_rowcount from T_roleright where roleid=v_roleid and modelid=v_modelid and rightid=v_rightid;
    if v_rowcount = 0 then
      insert into T_roleright(ROLERIGHTID,roleid,modelid,rightid,enabled) values(S_T_ROLERIGHT.Nextval, v_roleid,v_modelid,v_rightid,v_enabled);
  else
   update T_roleright set enabled=v_enabled where roleid=v_roleid and modelid=v_modelid and rightid=v_rightid;
    end if;
    commit;
end usp_SetRoleRight;

 

我调用的方法是:

OracleConnection connection = new OracleConnection(connectionString);
   OracleDataReader returnReader;
   connection.Open();
   OracleCommand command = BuildQueryCommand( connection,storedProcName, parameters );
   command.CommandType = CommandType.StoredProcedure;
            returnReader = command.ExecuteReader(CommandBehavior.CloseConnection); 

希望大家帮忙下!

help_hostwork的主页 help_hostwork | 初学一级 | 园豆:6
提问于:2010-08-04 17:39
< >
分享
其他回答(1)
0

用 NUMBER.

Launcher | 园豆:45045 (高人七级) | 2010-08-04 18:04
你这个 parameters 里填写的所有存储过程使用的参数的参数名称不要加冒号“ : ”。比如你的第一个参数,不要用[:v_roleid] 直接 [v_roleid].
支持(0) 反对(0) Launcher | 园豆:45045 (高人七级) | 2010-08-15 22:12
0

创建的表的字段类型用number类型

王文科 | 园豆:175 (初学一级) | 2010-08-04 22:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册