使用输入和返回的参数从ASP VBSCRIPT调用oracle存储过程
问题描述:
我从ASP-VBSCRIPT网站连接到一个oracle数据库,并且想要执行一个接受输入参数以及返回一些参数的存储过程。该存储的过程如下:使用输入和返回的参数从ASP VBSCRIPT调用oracle存储过程
p_std_currency.get_currency_details(input1,input2,input3,input4,output1,output2)
输入1-4的参数(第三是日期)发送给程序,而output1-2是场/项,其中所返回的参数被发送。 我已经试过上述调整到下面的ASP VBsript没有成功:
Set oConn_send = Server.CreateObject ("ADODB.Connection")
sConnectString_send = "Provider=MSDAORA.1;Data Source=demodbas;User Id=user Password=pas;"
oConn_send.Open sConnectString_send
oConn_send.ActiveConnection = oConn_send
oConn_send.CommandType = adCmdStoredProc
oConn_send.Properties("PLSQLRSet") = TRUE
oConn_send.CommandText = "p_std_currency.get_currency_details"
oConn_send.Parameters.Append oConn_send.CreateParameter(9,10,"01-JAN-10",1,crate_value,crate_id_no)
Set objSearch = oConn_send.Execute
Response.Write crate_value
Response.Write crate_id_no
任何想法?谢谢。
答
我至少可以看到这三个问题:
必须调用
CreateParameter
每个参数一次,即6倍。您必须使用
ADODB.Command
而不是ADODB.Connection
来发送命令。输出参数可以使用
cmd.Parameters(0)
和cmd.Parameters(1)
来检索。
我推荐看看这个例子:http://support.microsoft.com/kb/164485/en-us。它适用于SQL Server,但也应该与Oracle合作。