CREATE OR REPLACE PACKAGE "JINXDC1" as type v_cursor is ref cursor;procedure jinxdcbb( in_huoh in xsdmk.huop.huoh%type, in_cangwh in xsxt.cangw.cangwh%type, in_dalh in xsdmk.huopdlb.dlh%type, in_qisrq in varchar2, in_zhongzrq in varchar2, out_cursor in out v_cursor); end jinxdc1; CREATE OR REPLACE PACKAGE BODY "JINXDC1" isprocedure jinxdcbb(in_huoh in xsdmk.huop.huoh%type, in_cangwh in xsxt.cangw.cangwh%type, in_dalh in xsdmk.huopdlb.dlh%type, in_qisrq in varchar2, in_zhongzrq in varchar2, out_cursor in out v_cursor )is
begin delete from xs_op.ghctemp; delete from xs_op.ghctemp1;
insert into xs_op.ghctemp1(riq,hh,chuzje) select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl) from xsbb.ghcjxdcbb where (riq,cwh,huoh) in (select max(riq),cwh,huoh from xsbb.ghcjxdcbb where cwh like in_cangwh and huoh like in_huoh and riq<to_date(in_qisrq,'yyyy-mm-dd') group by huoh,cwh) group by huoh;
insert into xs_op.ghctemp1(riq,hh,qimje,zaitje,lingtsl) select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl),sum(zaitsl),sum(lingtztsl) from xsbb.ghcjxdcbb where (riq,cwh,huoh) in (select max(riq),cwh,huoh from xsbb.ghcjxdcbb where cwh like in_cangwh and huoh like in_huoh and riq<to_date(in_zhongzrq,'yyyy-mm-dd') group by huoh,cwh) group by huoh;
insert into xs_op.ghctemp1 (riq,hh,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje,lingsyjje,lingsbjje,lingswjje,pisje) select to_date(in_qisrq,'yyyy-mm-dd'),huoh, sum(ruksl),sum(yirsl),sum(panysl),sum(lingtsl),sum(pitsl),sum(tuigsl),sum(yicsl), sum(panksl),sum(lingsyjsl),sum(lingsbjsl),sum(lingswjsl),sum(pissl) from xsbb.ghcjxdcbb where riq between to_date(in_qisrq,'yyyy-mm-dd') and to_date(in_zhongzrq,'yyyy-mm-dd') and cwh like in_cangwh and huoh like in_huoh group by huoh ;
insert into xs_op.ghctemp (riq,hh,chuzje,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje, lingsyjje,lingsbjje,lingswjje,pisje,zaitje,qimje,bzje,lingtsl) (select to_date(in_qisrq,'yyyy-mm-dd'),hh,sum(chuzje), sum(rukje),sum(yirje),sum(panyje), sum(lingtje),sum(pitje),sum(tuigje),sum(yicje),sum(pankje),sum(lingsyjje), sum(lingsbjje), sum(lingswjje),sum(pisje),sum(zaitje),sum(qimje),sum(bzje),sum(lingtsl) from xs_op.ghctemp1 where hh like in_huoh group by hh);
delete xs_op.ghctemp where chuzje=0 and rukje=0 and yirje=0 and panyje=0 and lingtje=0 and pitje = 0 And tuigje = 0 And yicje = 0 And pankje = 0 And lingsyjje = 0 And lingsbjje = 0 And lingswjje = 0 and pisje=0 and zaitje=0 and qimje=0 and bzje=0 and lingtsl=0;
open out_cursor for select a.hh,b.huom, a.chuzje, a.rukje + a.yirje+ a.lingtje + a.pitje, a.tuigje+a.pisje +a.yicje +a.lingsyjje+a.lingsbjje, a.panyje-a.pankje ,a.qimje, a.zaitje ,a.lingtsl from xs_op.ghctemp a,xsdmk.huop b where b.dlh like in_dalh and a.hh=b.huoh and a.hh like in_huoh order by a.hh ;
to penitent(只取一瓢);在asp里有错误都会报 “缺少 'End' ”错误。
recd.Open
recd.movefirst '应当是这一句错了
就是说,你的recd不存在,过程没有执行成功,但是你认为成功了.
response.write "recordset not exists'
response.end
end if
if recd.eof then
response.write "no record"
response.end
end if
set recd = Server.CreateObject("ADODB.Recordset")
放在包含文件里了。
把resordset放在文件是设计好的,我也没办法。
<!--#include file="Connections/conn.asp" -->
<%
set cm1 = Server.CreateObject("ADODB.Command")
cm1.ActiveConnection = MM_conn_STRING
cm1.CommandType = 1
cm1.CommandTimeout = 0
cm1.Prepared = true
cm1.CommandText = "{call pkg_test.get(?)}"//(?,{resultset 0, myrctype})
set para = cm1.Parameters
para.Append cm1.CreateParameter("p_id",3,1,,1)
set rs = Server.CreateObject("ADODB.Recordset")
//rs.CursorType = 0
//rs.CursorLocation = 3
//rs.LockType = 3
//set rs.Source = cm1
//rs.Open()
set rs=cm1.Execute
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>中山大学附属第五医院</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/med.css" type=text/css rel=stylesheet>
</head>
<body bgcolor="#B2CFE4" text="#000000">
<%
while not rs.eof
response.write rs("name")
rs.movenext()
wend %></body>
</html>
<%
rs.close
cm1.ActiveConnection.Close
set cm1=nothing
%>
应当是你的存取过程执行失败了
你的rs还是关闭状态
所以rs.eof rs.move都会出错.
而recd is nothing 检测不到,试试用isnull(recd)能不能检测到
---------------
饿哦怀疑你的过程执行失败了.没有返回记录集过来
cm1.CommandTimeout = 0
cm1.Prepared = true
出现如下错误:
Microsoft VBScript 编译器错误 错误 '800a03f6' 缺少 'End' /iisHelp/common/500-100.asp,行242 Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' [Microsoft][ODBC driver for Oracle]无法绑定 PL/SQL 记录或游标引用 /wanzh/wwww/pifywcx/cangkjxccx.asp,行9797行即为: recd.Open 这一句两位再帮我看看,多谢了。
cmd.CommandText = "{call jinxdc1.jinxdcbb(?,?,?,?,?,)}"另外把包内容帖出来吧.
type v_cursor is ref cursor;procedure jinxdcbb( in_huoh in xsdmk.huop.huoh%type,
in_cangwh in xsxt.cangw.cangwh%type,
in_dalh in xsdmk.huopdlb.dlh%type,
in_qisrq in varchar2,
in_zhongzrq in varchar2,
out_cursor in out v_cursor);
end jinxdc1;
CREATE OR REPLACE PACKAGE BODY "JINXDC1" isprocedure jinxdcbb(in_huoh in xsdmk.huop.huoh%type,
in_cangwh in xsxt.cangw.cangwh%type,
in_dalh in xsdmk.huopdlb.dlh%type,
in_qisrq in varchar2,
in_zhongzrq in varchar2,
out_cursor in out v_cursor )is
begin
delete from xs_op.ghctemp;
delete from xs_op.ghctemp1;
insert into xs_op.ghctemp1(riq,hh,chuzje)
select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl)
from xsbb.ghcjxdcbb
where (riq,cwh,huoh) in
(select max(riq),cwh,huoh from xsbb.ghcjxdcbb
where cwh like in_cangwh and huoh like in_huoh
and riq<to_date(in_qisrq,'yyyy-mm-dd') group by huoh,cwh)
group by huoh;
insert into xs_op.ghctemp1(riq,hh,qimje,zaitje,lingtsl)
select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl),sum(zaitsl),sum(lingtztsl)
from xsbb.ghcjxdcbb
where (riq,cwh,huoh) in
(select max(riq),cwh,huoh from xsbb.ghcjxdcbb
where cwh like in_cangwh and huoh like in_huoh
and riq<to_date(in_zhongzrq,'yyyy-mm-dd') group by huoh,cwh)
group by huoh;
insert into xs_op.ghctemp1 (riq,hh,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje,lingsyjje,lingsbjje,lingswjje,pisje)
select to_date(in_qisrq,'yyyy-mm-dd'),huoh, sum(ruksl),sum(yirsl),sum(panysl),sum(lingtsl),sum(pitsl),sum(tuigsl),sum(yicsl),
sum(panksl),sum(lingsyjsl),sum(lingsbjsl),sum(lingswjsl),sum(pissl)
from xsbb.ghcjxdcbb where riq between to_date(in_qisrq,'yyyy-mm-dd') and to_date(in_zhongzrq,'yyyy-mm-dd')
and cwh like in_cangwh and huoh like in_huoh group by huoh ;
insert into xs_op.ghctemp (riq,hh,chuzje,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje,
lingsyjje,lingsbjje,lingswjje,pisje,zaitje,qimje,bzje,lingtsl)
(select to_date(in_qisrq,'yyyy-mm-dd'),hh,sum(chuzje), sum(rukje),sum(yirje),sum(panyje),
sum(lingtje),sum(pitje),sum(tuigje),sum(yicje),sum(pankje),sum(lingsyjje), sum(lingsbjje),
sum(lingswjje),sum(pisje),sum(zaitje),sum(qimje),sum(bzje),sum(lingtsl)
from xs_op.ghctemp1 where hh like in_huoh group by hh);
delete xs_op.ghctemp where chuzje=0 and rukje=0 and yirje=0 and panyje=0 and lingtje=0 and pitje = 0 And tuigje = 0
And yicje = 0 And pankje = 0 And lingsyjje = 0 And lingsbjje = 0 And lingswjje = 0 and pisje=0 and zaitje=0
and qimje=0 and bzje=0 and lingtsl=0;
open out_cursor for
select a.hh,b.huom, a.chuzje, a.rukje + a.yirje+ a.lingtje + a.pitje,
a.tuigje+a.pisje +a.yicje +a.lingsyjje+a.lingsbjje, a.panyje-a.pankje ,a.qimje, a.zaitje ,a.lingtsl
from xs_op.ghctemp a,xsdmk.huop b where b.dlh like in_dalh and a.hh=b.huoh and a.hh like in_huoh order by a.hh ;
end jinxdcbb;
end jinxdc1;
如果没有错,就是你的recd没有正常的得到记录集
至于怎么没有得到记录集,还需要你自己查
我想还是你没有得到记录集,
developer里运行了存储过程,成功,不代表程序能成功
自已新建一个在程序代码中,再执行看结果怎样。多方面考虑。