本文介绍了Oracle / ASP挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ORacle OLEdB

驱动程序(OraOLEDB)通过ASP页面连接到Oracle 9i。当我尝试在ASP中执行以下vbscript代码

时,我的页面挂起(没有超时,没有错误等)它看起来好像

它仍在检索页面。我已经在SQL plus中直接运行SQL语句

并运行run。我从sql

加上执行包...它运行得很好。表格中只有1条记录,因此

大量数据不是问题。当我使用这个完全相同的格式用于我选择数据的任何

其他表时,这项工作。唯一的区别

是我在sql

语句中从多个表中选择数据。为什么只是这个表,这个包,或者这个ASP vbscript

函数?


连接字符串

------ ----------------

Public Const cst_Tasks_ConnectionString =

" Provider = OraOLEDB.Oracle; Password = XXXXX; User ID = XXXXX;数据

Source = XXXXXX; PLSQLRSet = 1; OLEDB.NET = false"

ASP代码

------ ------

函数b_GetWorkOrders()


出错时接下来


dim cmd


设置conn = Server.CreateObject(" ADODB.Connection")

conn.Open cst_Tasks_ConnectionString

conn.cursorlocation = adUseClient


set cmd = server.CreateObject(" ADODB.Command")

设置cmd.ActiveConnection = conn

cmd.CommandText =" PRJMGMT.pkgWorkOrders.procGetWorkOrders"

set rsWorkOrders = Server.CreateObject(" ADODB.Recordset")

rsWorkOrders.CursorLocation = adUseclient

rsWorkOrders.locktype = adLockReadOnly

rsWorkOrders.cursortype = adOpenForwardOnly


set rsWorkOrders = cmd.Execute


如果err.number = 0那么

如果不是(rsWorkOrders.BOF和rsWorkOrders.EOF)那么

b_GetWorkOrders = true

else

b_GetWorkOrders = false

结束如果

else

Response.Write err.Description

回复.end

b_GetWorkOrders = false

结束如果


''清理

set cmd.ActiveConnection =没有

设置rsWorkOrders.activeconnection =没有

conn.close


结束功能



----------------------------------

创建或替换包PRJMGMT.pkgWorkOrders AS

TYPE CURSOR_TYPE是REF CURSOR;

程序procGetWorkOrders(RESULT_SET_1 OUT CURSOR_TYPE);

END pkgWorkOrders;

/

创建或更换包装P RJMGMT.pkgWorkOrders AS


程序procGetWorkOrders(RESULT_SET_2 OUT CURSOR_TYPE)

AS

BEGIN

OPEN RESULT_SET_2 FOR

SELECT wo.work_order_id,wo.work_order_type_cd,

wo.creation_datetime,wo.project_id,p.project_name,

wo.technical_contact ,wo.requested_completion_date,

wo.production_date,wo.actual_start_date,

wo.estimated_completion_date,wo.actual_completion_date,

wo.priority_id,pr .priority_name,wo.service_level_id,

sl.service_level_name,wo.work_type_id,wt.work_type_name,

wo.status_id,s.status_name,c.customer_name

来自PRJMGMT.WORK_ORDERS wo,PRJMGMT.PROJECTS p,

PRJMGMT.PRIORITIES pr,PRJMGMT.SERVICE_LEVELS sl,PRJMGMT.WORK_TYPES

wt,PRJMGMT.STATUS s ,PRJMGMT.CUSTOMERS c

WHERE p.project_id = wo.project_id和pr.priority_id =

wo.priority_id和sl.service_level_id = wo.service_level_id and

wt.work_type_id = wo.work_type_id和s.status_id = wo.status_id和

c.customer_id = p.customer_id

END procGetWorkOrders;


结束pkgWorkOrders;


/

PR PR PR PR PR PR PR PR PR PR PR PR PR
>>>>>>>> b $ b /

I am connecting to Oracle 9i via an ASP page using the ORacle OLEdB
driver (OraOLEDB). When I try to execute the following vbscript code
in ASP my page hangs(no timeouts, no errors, etc.) It just looks like
it is still retreiving the page. I have run the SQL statement directly
in SQL plus and it runs run. I executed the package from sql
plus...it too runs fine. There is only 1 record in the table so too
much data is not an issue. When I use this exact same format for any
other table that I select data from, this work. The only difference
is that I am selecting data from more than 1 table in the sql
statement. Why just this table, this package, or this ASP vbscript
function?

Connection String
----------------------
Public Const cst_Tasks_ConnectionString =
"Provider=OraOLEDB.Oracle;Password=XXXXX;User ID=XXXXX;Data
Source=XXXXXX;PLSQLRSet=1;OLEDB.NET=false"
ASP Code
------------
Function b_GetWorkOrders()

on error resume next

dim cmd

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open cst_Tasks_ConnectionString
conn.cursorlocation = adUseClient

set cmd = server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
cmd.CommandText = "PRJMGMT.pkgWorkOrders.procGetWorkOrders"

set rsWorkOrders = Server.CreateObject("ADODB.Recordset")
rsWorkOrders.CursorLocation = adUseclient
rsWorkOrders.locktype = adLockReadOnly
rsWorkOrders.cursortype = adOpenForwardOnly

set rsWorkOrders = cmd.Execute

if err.number = 0 then
if not(rsWorkOrders.BOF and rsWorkOrders.EOF) then
b_GetWorkOrders = true
else
b_GetWorkOrders = false
end if
else
Response.Write err.Description
Response.end
b_GetWorkOrders = false
end if

''Cleanup
set cmd.ActiveConnection = nothing
set rsWorkOrders.activeconnection = nothing
conn.close

End function
Package
----------------------------------
CREATE OR REPLACE PACKAGE PRJMGMT.pkgWorkOrders AS
TYPE CURSOR_TYPE IS REF CURSOR;
PROCEDURE procGetWorkOrders(RESULT_SET_1 OUT CURSOR_TYPE);
END pkgWorkOrders;
/
CREATE OR REPLACE PACKAGE BODY PRJMGMT.pkgWorkOrders AS

PROCEDURE procGetWorkOrders(RESULT_SET_2 OUT CURSOR_TYPE)
AS
BEGIN
OPEN RESULT_SET_2 FOR
SELECT wo.work_order_id, wo.work_order_type_cd,
wo.creation_datetime, wo.project_id, p.project_name,
wo.technical_contact, wo.requested_completion_date,
wo.production_date, wo.actual_start_date,
wo.estimated_completion_date, wo.actual_completion_date,
wo.priority_id, pr.priority_name, wo.service_level_id,
sl.service_level_name, wo.work_type_id, wt.work_type_name,
wo.status_id, s.status_name, c.customer_name
FROM PRJMGMT.WORK_ORDERS wo, PRJMGMT.PROJECTS p,
PRJMGMT.PRIORITIES pr, PRJMGMT.SERVICE_LEVELS sl, PRJMGMT.WORK_TYPES
wt, PRJMGMT.STATUS s, PRJMGMT.CUSTOMERS c
WHERE p.project_id = wo.project_id and pr.priority_id =
wo.priority_id and sl.service_level_id = wo.service_level_id and
wt.work_type_id = wo.work_type_id and s.status_id = wo.status_id and
c.customer_id = p.customer_id
END procGetWorkOrders;

END pkgWorkOrders;

/
GRANT EXECUTE ON PRJMGMT.pkgWorkOrders TO PRJMGMT;
/

推荐答案






嗯,好的,然后先:


当我说Set ...到"我的意思是:cmd.CommandType = adCmdStoredProc


其次,为什么不使用调试器来查看哪一行你现在获得了错误?
?或者,注释掉接下来的错误恢复。所以IIS

将错误转储到输出。


欢呼,

Ross。

-

Ross McKay,WebAware Pty Ltd

从什么时候开始这么慷慨? - Elvis Costello



Um, ok, then first:

When I said "Set ... to" I meant: cmd.CommandType = adCmdStoredProc

Secondly, why not use a debugger to see which line you get the error on
now? Or alternatively, comment out "on error resume next" so that IIS
dumps the error to the output.

cheers,
Ross.
--
Ross McKay, WebAware Pty Ltd
"Since when were you so generously inarticulate?" - Elvis Costello


这篇关于Oracle / ASP挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 10:22