简体   繁体   English

Oracle C#调用过程

[英]Oracle C# Call Procedure

I have such procedure 我有这样的程序

PROCEDURE FILL_NDRMCA (res OUT number)  AS  
begin
   ..........
   res:=1;
end FILL_NDRMCA;

when i call procedure from c# i get this exception 当我从C#调用过程时,出现此异常

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'FILL_NDRMCA'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored .

my c# code 我的C#代码

SWProcedureExecuter pe = new SWProcedureExecuter("OC_YKB.NDRM.FILL_NDRMCA");
pe.AddParameter("res",String.Empty, SWParameterDirection.Output);
pe.Execute();
Int32  resultResultCode = (Int32)pe.GetValue("res");        
Result =resultResultCode;

Can you help me ? 你能帮助我吗 ? Thanks 谢谢

in the SP the param is "NUMBER" 在SP中,参数为“ NUMBER”

But when calling the SP you'r using the value "String.Empty" so the SP recives a VARCHAR param. 但是,在调用SP时,您使用的是“ String.Empty”值,因此SP会获取VARCHAR参数。

Try changing: 尝试更改:

pe.AddParameter("res", String.Empty, SWParameterDirection.Output);

to

pe.AddParameter("res", 0, SWParameterDirection.Output);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM