C# .net 执行oracle包报错..
时间:2011-12-20
来源:互联网
C#代码:
public void Conntion()
{
OracleConnection conn = null;
if (conn == null)
{
conn = new OracleConnection();
conn.ConnectionString = "User ID=system;Password=manager;Data Source=(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=Ora.finemoon)))";
}
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
OracleCommand command = new OracleCommand();
command.CommandText = "TestPackage.GetRecords";
command.Parameters.Add("ret_cursor", OracleType.Number);
command.Connection = conn;
command.CommandType = CommandType.StoredProcedure;
int it= command.ExecuteNonQuery();
int rpws=Convert.ToInt32(command.Parameters[0].Value);
}
oracle 代码:
create or replace package TestPackage is
procedure GetRecords(ret_cursor out number); -- 定义过程,用游标变量作为返回参数
end TestPackage;
--包体是这么定义的:
create or replace package body TestPackage is
procedure GetRecords(ret_cursor out number)
as
begin
ret_cursor:=1;
end GetRecords;
end TestPackage;
错误提示:
ORA-06550: 第 1 行, 第 7 列:
PLS-00905: 对象 SYSTEM.TESTPACKAGE 无效
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
public void Conntion()
{
OracleConnection conn = null;
if (conn == null)
{
conn = new OracleConnection();
conn.ConnectionString = "User ID=system;Password=manager;Data Source=(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=Ora.finemoon)))";
}
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
OracleCommand command = new OracleCommand();
command.CommandText = "TestPackage.GetRecords";
command.Parameters.Add("ret_cursor", OracleType.Number);
command.Connection = conn;
command.CommandType = CommandType.StoredProcedure;
int it= command.ExecuteNonQuery();
int rpws=Convert.ToInt32(command.Parameters[0].Value);
}
oracle 代码:
create or replace package TestPackage is
procedure GetRecords(ret_cursor out number); -- 定义过程,用游标变量作为返回参数
end TestPackage;
--包体是这么定义的:
create or replace package body TestPackage is
procedure GetRecords(ret_cursor out number)
as
begin
ret_cursor:=1;
end GetRecords;
end TestPackage;
错误提示:
ORA-06550: 第 1 行, 第 7 列:
PLS-00905: 对象 SYSTEM.TESTPACKAGE 无效
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
作者: feiji1019 发布时间: 2011-12-20
借宝地一用赚点可用分
作者: askandstudy1 发布时间: 2011-12-20
该回复于2011-12-20 15:52:02被管理员删除
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
|
#3楼 得分:0回复于:2011-12-20 16:01:41
|
作者: daf380 发布时间: 2011-12-20
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28