我正在研究从 sql 到 oracle 的迁移。我从未使用过经典的 asp,我可以在这方面使用一些帮助。
这是我现在拥有的代码
<select onChange="AlterarDisabled();/*DGT();*/" name="TIPO_PLANO" id="TIPO_PLANO">
<%
sSql = "TP_15_SP" & "'" & ENTIDADE & "'"
set oRS = GlobaloConn.Execute(sSql)
do while not oRS.Eof
if oRS.Fields(0) = "04" then
if BALCAO = "B0142" or BALCAO= "B0593" then
%><option value="<%=oRS.Fields(0)%>"><%=oRS.Fields(1)%></option><%
end if
else
%><option value="<%=oRS.Fields(0)%>"><%=oRS.Fields(1)%></option><%
end if
oRS.MoveNext
loop
set oRS = nothing
%>
</select>
这是sql存储过程
USE [TPS]
GO
/* Object: StoredProcedure [dbo].[TP_15_SP] Script Date: 10/02/2013 11:09:46 */
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[TP_15_SP] @CdEnt VARCHAR(4)
AS
SELECT * FROM TP_15
WHERE CDENT = @CdEnt
ORDER BY 1
现在我必须连接到 Oracle 并运行一个 oracle 函数。这是预言机功能
create or replace
function TP_15_FN(v_CdEnt IN VARCHAR2) return SYS_REFCURSOR
as
l_return SYS_REFCURSOR;
BEGIN
-- This procedure was converted on Fri Apr 05 17:05:05 2013
open l_return for SELECT * FROM TP_15
WHERE CDENT = v_CdEnt
ORDER BY 1 NULLS FIRST;
return l_return;
END;
这是我应该用来调用该函数的代码。据说我需要的只是
sSql = "TP_15_SP" & "'" & ENTIDADE & "'"
变成sSql = "TP_15_FN(" & "'" & ENTIDADE & "')"
. 它不起作用,有什么想法吗?
<select onChange="AlterarDisabled();/*DGT();*/" name="TIPO_PLANO" id="TIPO_PLANO">
<%
sSql = "TP_15_FN(" & "'" & ENTIDADE & "')"
set oRS = GlobaloConn.Execute(sSql)
do while not oRS.Eof
if oRS.Fields(0) = "04" then
if BALCAO = "B0142" or BALCAO= "B0593" then
%><option value="<%=oRS.Fields(0)%>"><%=oRS.Fields(1)%></option><%
end if
else
%><option value="<%=oRS.Fields(0)%>"><%=oRS.Fields(1)%></option><%
end if
oRS.MoveNext
loop
set oRS = nothing
%>
</select>