简体   繁体   English

ORA-06550:第1行,第37列:PLS-00201:必须声明标识符“ XYZ”

[英]ORA-06550: line 1, column 37: PLS-00201: identifier 'XYZ' must be declared

When i try to access and excute a store procedure through following C# code Here is my C# code 当我尝试通过以下C#代码访问和执行存储过程时,这是我的C#代码

   OracleParameter op = null;
   OracleDataReader dr = null;

   OracleCommand cmd = new OracleCommand();

   cmd.CommandText = "pkg_prov_index.getNextPanel";
   cmd.CommandType = CommandType.StoredProcedure;


  op = new OracleParameter("pCurrentPanelId", OracleDbType.Int32);
  op.Direction = ParameterDirection.Input;
  op.Value = masterProviderIndex.CurrentPanelId;
  cmd.Parameters.Add(op);
  op = new OracleParameter("pRefCursor", OracleDbType.RefCursor);
  op.Direction = ParameterDirection.inputOutput;
  cmd.Parameters.Add(op);
  dr =cmd.ExecuteReader(); Here , it gives me an error that says ORA-06550: line 1,   column 37: PLS-00201: identifier 'XYZ' must be declared at 
  if(dr.HasRows)
  {while(dr.Read())
     {
     }
  }

I do have the permissions to access and execute the stored procedure so no issues with that. 我确实具有访问和执行存储过程的权限,因此没有任何问题。 And when I opened and saw the Stored Procedure in Sql Developer it has an input and output cursor(input cursor is there for reading so many columns as SP is just nothing but a select statement along with a where clause on a View which is written involving 5 tables together and then output cursor is for writing the output result of that SP).Thats what my understanding of cursor is ..since I'm a .Net guy not an oracle expert.Now coming back to the most important point. 当我打开并看到Sql Developer中的存储过程时,它有一个输入和输出游标(输入游标在那里可以读取这么多列,因为SP只是一个select语句,而一个View的where子句则包含在其中,将5个表放在一起,然后输出游标用于写入该SP的输出结果。这就是我对游标的理解,因为我是.Net而不是oracle专家。现在回到最重要的一点。 If you guys look in to my code for input/output cursor all I get is oracledbtype.refcursor in C# enumeration for oracledbtype but the oracle SP is using an input/ouput cursor, is this the root of my error, because I'm sending an input/output parameter as refcursor whereas oracle SP has input/output cursor not a refcursor, but refcursor is all I get when writing code using C#. 如果你们查看我输入/输出游标的代码,我得到的只是oracledbtype的C#枚举中的oracledbtype.refcursor,但是oracle SP使用的是输入/输出游标,这是我错误的根源,因为我正在发送输入/输出参数作为refcursor,而oracle SP的输入/输出游标不是refcursor,但是refcursor是我在使用C#编写代码时得到的全部。 Your help will be much appreciated. 您的帮助将不胜感激。 Thanks. 谢谢。

Before the CommandText You should try giving a name to the procedure like this: CommandText之前,您应尝试为该过程命名,如下所示:

OracleCommand cmd = new OracleCommand("getNextPanel", _conn);

The parameter OracleParameter must match exactly the parameter name(not only the type) when you call it by CommandType.StoredProcedure 当您通过CommandType.StoredProcedure调用时,参数OracleParameter必须与参数名称(不仅是类型)完全匹配。

Why is there cmd.Parameters.Add(op); 为什么会有cmd.Parameters.Add(op); going twice? 要去两次? Also, op.Direction = ParameterDirection.inputOutput; 另外, op.Direction = ParameterDirection.inputOutput; the "i" letter must be upper cased (probably typo). “ i”字母必须大写(可能是错字)。

The steps given is taken by a working example which I developed, following these steps: Calling Oracle stored procedure from C#? 给出的步骤由我开发的一个工作示例执行,遵循以下步骤: 从C#调用Oracle存储过程?

暂无
暂无

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

相关问题 标识符必须声明为 ORA-06550 和 PLS-00201 - Identifier must be declared ORA-06550 and PLS-00201 PLS-00201:必须声明标识符“ schema.cursorname” - PLS-00201: identifier 'schema.cursorname' must be declared “ASP.NET / C#中必须声明”pls-00201标识符 - “pls-00201 identifier must be declared” in ASP.NET/C# ORA-06550第10行,第41列:PLS-00103:在预期以下情况之一时遇到了符号“,”: - ORA-06550 line 10, column 41: PLS-00103: Encountered the symbol “,” when expecting one of the following: ORA-06550:第1行第7列:PLS-00306:参数的数量或类型错误 - ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments ORA-06550:第 1 行,第 7 列:PLS-00306:调用“INSERTBILL”时 arguments 的编号或类型错误 - ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'INSERTBILL' System.Data.OracleClient.OracleException:ORA-06550:第1行第7列: - System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: ORA-06550,PLS-00306; 将数据插入Oracle过程时出错 - ORA-06550, PLS-00306; Error inserting data to Oracle procedure 存储过程调用给出错误PLS-00306 ORA-06550 - Stored procedure call gives an error PLS-00306 ORA-06550 ORA-06550:第1行,第7列:\\ nPLS-00905:对象TEST.CMPPROJECTPROC无效\\ nORA-06550:第1行,第7列:\\ nPL / SQL:语句被忽略“} - ORA-06550: line 1, column 7:\nPLS-00905: object TEST.CMPPROJECTPROC is invalid\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored"}
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM