从asp.net调用存储过程并且声明丢失

时间:2014-02-19 10:13:30

标签: c# asp.net oracle

当我试图将sp调用到异常以下时..

  

System.Data.OracleClient.OracleException:ORA-06550:第1行第7列:   PLS-00201:必须声明标识符'ULTIMUS.PUSH_PULL_MESSAGE'   ORA-06550:第1行第7列:   PL / SQL:忽略语句

     

at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle,Int32 rc)      在System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle,CommandBehavior behavior,Boolean needRowid,OciRowidDescriptor& rowidDescriptor,ArrayList& resultParameterOrdinals)      在System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid,OciRowidDescriptor& rowidDescriptor)      在System.Data.OracleClient.OracleCommand.ExecuteNonQuery()      at _Default.GetPushPullReply(String msisdn,String sms,String shortcode)在c:\ inetpub \ wwwroot \ pushpullapps \ Default.aspx.cs:第73行

目前我正在使用...以下代码..

OracleConnection con = new OracleConnection();
con.ConnectionString = conString;
con.Open();
OracleCommand mycom = new OracleCommand();
mycom.CommandText = "ultimus.push_pull_message";
mycom.Connection = con;
mycom.CommandType = CommandType.StoredProcedure;
saveSer("Calling sp...");
mycom.Parameters.Add("cell_no", OracleType.VarChar, 2000).Value = msisdn;
mycom.Parameters["cell_no"].Direction = ParameterDirection.Input;
mycom.Parameters.Add("msg_txt", OracleType.VarChar, 2000).Value = sms;
mycom.Parameters["msg_txt"].Direction = ParameterDirection.Input;
mycom.Parameters.Add("msg_out", OracleType.VarChar, 2000).Direction = ParameterDirection.Output;
saveSer("adding parameter...");
mycom.ExecuteNonQuery();
saveSer("Execute successfully....");
String output = mycom.Parameters["msg_out"].Value.ToString();
saveSer("Output found..." + output);
con.Close();
return output;

1 个答案:

答案 0 :(得分:0)

您使用什么用户连接数据库? 如果ultimus是包名,并且包所在的架构不同,因为您连接的用户也必须添加架构:

 "schemaname.ultimus .push_pull_message";