• 主页
  • Oracle 基础和管理
  • Oracle 高级技术
  • Oracle 认证与考试
ywcannon 2005年03月17日
急,asp调用oracle存储过程返回记录集出错(80040e21),高手帮忙啊!!!
我在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

请问各位高手这是什么问题啊,该怎么解决啊???
...全文
104 点赞 收藏 4
写回复
4 条回复

还没有回复,快来抢沙发~

发动态
发帖子
Oracle
创建于2007-09-28

6401

社区成员

5.4w+

社区内容

Oracle开发相关技术讨论
社区公告
暂无公告