c#调用oracle存储过程问题
存储过程(在PLSQL中调试没错):
create or replace procedure PROC_StudentInfo_SEL(studentid varchar2,
studentinfo OUT SYS_REFCURSOR) is
begin
open studentinfo for
select * from scott.student where scott.student.studentid = studentid;
end PROC_StudentInfo_SEL;
C#程序:
_conn.Open();
ConnectionState state = _conn.State;
_command = new OracleCommand();
_command.Connection = _conn;
//_command.Transaction = _conn.BeginTransaction();
_command.CommandType = CommandType.StoredProcedure;
_command.CommandText = "Scott.PROC_StudentInfo_SEL";
OracleParameter para = new OracleParameter("studentid", OracleType.VarChar, 2000);
para.Direction = ParameterDirection.Input;
para.Value = "001";
_command.Parameters.Add(para);
para = new OracleParameter("studentinfo", OracleType.Cursor);
para.Direction = ParameterDirection.Output;
_command.Parameters.Add(para);
OracleDataAdapter adapter = new OracleDataAdapter(_command);
DataTable table = new DataTable();
adapter.Fill(table);
打开数据库也没问题,执行到adapter.fill时,出现错误:
ORA-06550: 第 1 行, 第 7 列:
PLS-00201: 必须声明标识符 'SCOTT.PROC_STUDENTINFO_SEL'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
请教各位高手,这是什么问题。
create or replace procedure PROC_StudentInfo_SEL(studentid varchar2,
studentinfo OUT SYS_REFCURSOR) is
begin
open studentinfo for
select * from scott.student where scott.student.studentid = studentid;
end PROC_StudentInfo_SEL;
C#程序:
_conn.Open();
ConnectionState state = _conn.State;
_command = new OracleCommand();
_command.Connection = _conn;
//_command.Transaction = _conn.BeginTransaction();
_command.CommandType = CommandType.StoredProcedure;
_command.CommandText = "Scott.PROC_StudentInfo_SEL";
OracleParameter para = new OracleParameter("studentid", OracleType.VarChar, 2000);
para.Direction = ParameterDirection.Input;
para.Value = "001";
_command.Parameters.Add(para);
para = new OracleParameter("studentinfo", OracleType.Cursor);
para.Direction = ParameterDirection.Output;
_command.Parameters.Add(para);
OracleDataAdapter adapter = new OracleDataAdapter(_command);
DataTable table = new DataTable();
adapter.Fill(table);
打开数据库也没问题,执行到adapter.fill时,出现错误:
ORA-06550: 第 1 行, 第 7 列:
PLS-00201: 必须声明标识符 'SCOTT.PROC_STUDENTINFO_SEL'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
请教各位高手,这是什么问题。
...全文
相关推荐
C#调用Oracle存储过程的方法
在C#中调用Oracle存储过程是常见的数据交互操作,特别是在需要执行复杂数据库逻辑时。以下将详细介绍如何在C#中通过ADO.NET库来调用Oracle存储过程。
C#中调用Oracle存储过程
**减少网络通信量**:只需发送存储过程名及参数,而非整个SQL语句,降低了网络负载。#### 三、C#中调用Oracle存储过程的方法在C#中调用Oracle存储过程主要涉及以下几个步骤:1.
在.NET中调用Oracle存储过程经验总结[定义].pdf
本篇文章主要针对.NET开发者,特别是使用C#语言的开发人员,分享了在.NET中调用Oracle9i存储过程的经验与技巧。首先,我们来看如何调用带有输入和输出参数的存储过程。
C#访问Oracle存储过程实例源码
在完成对存储过程的调用后,别忘了关闭数据库连接以释放资源:```csharpconn.Close();```这就是一个基本的C#通过VS2010访问Oracle存储过程的例子。
oracle数据库中查看系统存储过程的方法
;```在应用程序中调用Oracle存储过程,例如在ASP.NET或C#中,通常会使用ADO.NET的`OracleCommand`对象来执行存储过程。


基础和管理
