CREATE OR REPLACE package hnzs.pkg_getlist
is
type mytype is ref cursor;
procedure getlist(in_wblb varchar2,mycs out mytype);
end; CREATE OR REPLACE package BODY hnzs.pkg_getlist
is
procedure getlist(in_wblb varchar2,mycs out mytype)
is
begin
open mycs for select fgbh,wjmc from zcfgxx where ycbz='1' and wblb=in_wblb;
end getlist;
end pkg_getlist;调用方法:
strcn=ConfigurationSettings.AppSettings["hnzs195"];
OracleConnection myConnection = new OracleConnection(strcn);
OracleCommand myCommand = new OracleCommand("hnzs.getlist", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
OracleParameter parameterwblb = new OracleParameter("in_wblb",OracleType.VarChar,4);
parameterwblb.Value = "1";
myCommand.Parameters.Add(parameterwblb);myCommand.CommandType = CommandType.StoredProcedure;
OracleParameter parametermycs = new OracleParameter("mycs",OracleType.Cursor);
parametermycs.Direction=System.Data.ParameterDirection.Output;
myCommand.Parameters.Add(parametermycs);OracleDataAdapter da=new OracleDataAdapter(myCommand);
DataSet ds=new DataSet();
da.Fill(ds,"zcfgxx");
this.zcfglist.DataSource=ds;
this.zcfglist.DataBind();IE运行提示错误:
ORA-06550: 第 1 行, 第 7 列: PLS-00201: 必须说明标识符 'HNZS.GETLIST' ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored
is
type mytype is ref cursor;
procedure getlist(in_wblb varchar2,mycs out mytype);
end; CREATE OR REPLACE package BODY hnzs.pkg_getlist
is
procedure getlist(in_wblb varchar2,mycs out mytype)
is
begin
open mycs for select fgbh,wjmc from zcfgxx where ycbz='1' and wblb=in_wblb;
end getlist;
end pkg_getlist;调用方法:
strcn=ConfigurationSettings.AppSettings["hnzs195"];
OracleConnection myConnection = new OracleConnection(strcn);
OracleCommand myCommand = new OracleCommand("hnzs.getlist", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
OracleParameter parameterwblb = new OracleParameter("in_wblb",OracleType.VarChar,4);
parameterwblb.Value = "1";
myCommand.Parameters.Add(parameterwblb);myCommand.CommandType = CommandType.StoredProcedure;
OracleParameter parametermycs = new OracleParameter("mycs",OracleType.Cursor);
parametermycs.Direction=System.Data.ParameterDirection.Output;
myCommand.Parameters.Add(parametermycs);OracleDataAdapter da=new OracleDataAdapter(myCommand);
DataSet ds=new DataSet();
da.Fill(ds,"zcfgxx");
this.zcfglist.DataSource=ds;
this.zcfglist.DataBind();IE运行提示错误:
ORA-06550: 第 1 行, 第 7 列: PLS-00201: 必须说明标识符 'HNZS.GETLIST' ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored
解决方案 »
- SQL高手进ORACLE中如何取连号?
- 请教一个锁表的问题
- 有原先数据库中的几个dbf文件,如果恢复数据库?
- 谁来帮我解决这个问题?
- 哪位有Sql Expert for oracle 3.62的注册码?请告知,谢谢!
- Oracle中的SELECT语句的一个关于AS的问题
- oracle有没有boolean类型的字段
- 存储过程中一条简单的语句出了错
- 两个表各自排序后再按权重合并后排序问题?求指点,谢谢
- Excel表导入Oracle的时候excel的序号不见了,怎么破?
- 请大家看看下面问题是不是由于CURSOR使用没有关闭,最后耗尽Oracle内存引起的!发表意见的都给分
- 新新手请教一个SQL语句问题.请高手进来赐教.同时祝你狗年快乐,心想事成
OracleCommand myCommand = new OracleCommand("hnzs.getlist", myConnection);
改成
OracleCommand myCommand = new OracleCommand("hnzs.pkg_getlist.getlist", myConnection);调用包中的过程,必须完全写出来