急,asp调用oracle存储过程返回记录集出错(80040e21),高手帮忙啊!!!

ywcannon 2005-03-17 02:52:18
我在oracle下建了个存储过程包,代码如下:

// 创建包,定义游标
CREATE OR REPLACE package pkg_select
as
type c_1 is ref cursor;
end;

// 创建存储过程
CREATE OR REPLACE PROCEDURE pageturn (
currentDispNO in number,
trunFlag in number,
refCur out pkg_select.c_1)
as
begin
if (trunFlag=1) then
open refCur for
select c.phonecode, c.cname, c.sex, t.carno, t.ani,
t.cartype, t.carcolor, d.no, d.calltime, d.disptype,
d.preordertime, d.geton, d.near, d.getoff, d.prehinttime,
d.carnum, d.priority, d.needctp, d.needccr, d.num, m.num
FROM (
select rownum num, no, calltime, disptype, preordertime,
geton, near, getoff, prehinttime, carnum, priority, needctp,
needccr, customid, carinfoid from dispatch ) d
left join taxi t ON d.carinfoid=t.id, custom c, (
select num from (
select rownum num, no from dispatch)
where no =currentDispNO) m
where d.customid=c.id and d.num=1+m.num;
close refCur;
else
open refCur for
select c.phonecode, c.cname, c.sex, t.carno, t.ani, t.cartype,
t.carcolor, d.no, d.calltime, d.disptype, d.preordertime,
d.geton, d.near, d.getoff, d.prehinttime, d.carnum, d.priority,
d.needctp, d.needccr, d.num, m.num
FROM (
select rownum num, no, calltime, disptype, preordertime,
geton, near, getoff, prehinttime, carnum, priority, needctp,
needccr, customid, carinfoid from dispatch ) d
left join taxi t ON d.carinfoid=t.id, custom c,(
select num from (
select rownum num, no from dispatch)
where no =currentDispNO) m
where d.customid=c.id and d.num=m.num-1;
close refCur;
end if;
end pageTurn;

然后我在asp页面调用此存储过程,代码如下:
<%
set objConn = server.createobject("adodb.connection")
connString = "Provider=OraOLEDB.Oracle;
Data Source=call;User Id=;Password=;PLSQLRSet=1;"
objConn.Open connString

set oCmd = Server.CreateObject("Adodb.Command")
set oCmd.ActiveConnection = objConn
oCmd.CommandText = "{call pageTurn(?)}"
oCmd.CommandType = adCmdText

Set oCmdNo=oCmd.CreateParameter("disp_no", adVariant, adParamInput, 10, 164)
oCmd.Parameters.Append oCmdNo

Set tmpThirdParam=oCmd.CreateParameter("turn_flag", adVariant, adParamInput, 10, 1)
oCmd.Parameters.Append tmpThirdParam

set oRsCmd = oCmd.Execute()

response.write oRsCmd.(0)
%>

结果页面出错,显示:
OraOLEDB 错误 '80040e21'
多步 OLE DB 产生错误。如果可能,请检查每个 OLE DB 状态值。没有工作被完成。
/proctest2.asp,行542

请问各位高手这是什么问题啊,该怎么解决啊???
...全文
166 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ywcannon 2005-03-25
  • 打赏
  • 举报
回复
谢谢楼上的回答,问题解决了,就是这个原因^-^!
结贴了。
阿妖 2005-03-25
  • 打赏
  • 举报
回复
是在调用过程的时候少了一个?参数导致调用失败
ywcannon 2005-03-17
  • 打赏
  • 举报
回复
谢谢楼上的,改成adCmdStoredProc后,产生如下错误:

OraOLEDB 错误 '80004005'
未指定的错误
/proctest2.asp,行543

adCmdText是我从一个网站上看来的,用那个网站上的例子,在我机器上做实验都是好的,但是换成我自己的存储过程,就出现一开始的错误了。
overmind 2005-03-17
  • 打赏
  • 举报
回复
oCmd.CommandType = storedProcedure??

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧