【问题标题】:Call oracle stored procedure from ASP VBSCRIPT with input and returned parameters使用输入和返回参数从 ASP VBSCRIPT 调用 oracle 存储过程
【发布时间】:2011-11-30 02:34:59
【问题描述】:

我从一个 ASP-VBSCRIPT 网站连接到一个 oracle 数据库,并希望执行一个接受输入参数并返回一些参数的存储过程。存储过程如下:

 p_std_currency.get_currency_details(input1,input2,input3,input4,output1,output2)

输入 1-4 是发送到过程的参数(第三个是日期),而输出 1-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

有什么想法吗?谢谢。

【问题讨论】:

    标签: oracle stored-procedures asp-classic vbscript


    【解决方案1】:

    我至少可以看到这三个问题:

    • 每个参数必须调用CreateParameter一次,即6次。

    • 您必须使用ADODB.Command,而不是ADODB.Connection,来发送命令。

    • 可以使用cmd.Parameters(0)cmd.Parameters(1)检索输出参数。

    我建议看看这个例子:http://support.microsoft.com/kb/164485/en-us。它适用于 SQL Server,但也适用于 Oracle。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      • 2015-08-18
      • 1970-01-01
      • 1970-01-01
      • 2012-04-18
      • 2016-06-03
      相关资源
      最近更新 更多