简体   繁体   English

调用使用来自Microsoft SQL Server的输出参数的Oracle存储过程

[英]Calling an Oracle stored procedure that uses an output parameter from Microsoft SQL Server

I am trying to execute a stored procedure on an Oracle 10g server, which returns its results in an output parameter, from a SQL Server 2008 query. 我正在尝试在Oracle 10g服务器上执行存储过程,该存储过程从SQL Server 2008查询以输出参数形式返回其结果。

The Oracle stored procedure declaration looks like this: Oracle存储过程声明如下所示:

 PROCEDURE MY_PROC(
     ID IN NUMBER,
     RESULT OUT CURSOR_TYPE);

How would I call this stored procedure from MS SQL Server 2008, using either OpenQuery or any method of querying Oracle, and be able to see the result set stored in 'RESULT'? 我将如何使用OpenQuery或任何查询Oracle的方法从MS SQL Server 2008中调用此存储过程,并能够看到存储在“ RESULT”中的结果集?

I did that from SQL SERVER to SQL SERVER and it's work well. 我从SQL SERVER到SQL SERVER都做到了,而且效果很好。 Maybe in Oracle you will need some chages. 也许在Oracle中,您将需要一些挑战。

here is my code in sql server 这是我在SQL Server中的代码

--drop proc proc_test_test create proc proc_test_test ( --drop proc proc_test_test创建proc proc_test_test(

@a int, @b int output @a int,@ b int输出

) as begin )开始

set @b = @a*6+4 设置@b = @ a * 6 + 4

end 结束

select * 选择 *

from openrowset('type','server name';'user';'pass', 来自openrowset('type','server name';'user';'pass',

'declare @answer int ; '声明@answer int;

exec db.dbo.proc_test_test @a = 1, @b = @answer output; exec db.dbo.proc_test_test @a = 1,@ b = @answer输出;

select @answer as a' ) 选择@answer作为a')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用SQL Server的输出参数调用Oracle存储过程 - Calling Oracle stored procedure with output parameter from SQL Server 从VB.NET应用程序调用SQL Server存储过程。 输出参数恢复为空白 - Calling SQL Server stored procedure from VB.NET application. Output parameter is coming back blank 在VBScript中调用Output参数的SQL存储过程 - Calling SQL Stored Procedure with Output Parameter in VBScript 分页脚本中的存储过程和输出参数(SQL Server 2008) - Stored Procedure and output parameter from paging script (SQL Server 2008) 从另一个存储过程 SQL Server 调用存储过程 - Calling stored procedure from another stored procedure SQL Server 将存储过程从oracle移动到sql server - Moving stored procedure from oracle to sql server 从Oracle执行SQL Server存储过程 - Execute SQL Server stored procedure from Oracle 从 SQL Server 存储过程调用 MySQL 存储过程/查询 - Calling MySQL stored procedure / query from SQL Server stored procedure 从SQL Server中的存储过程调用URL? - Calling a URL from a stored procedure in SQL Server? Postgresql:有没有办法从 Microsoft SQL Server 中的存储过程返回表数据和输出参数 - Postgresql: Is there a way to return both table data and output parameters from a stored procedure as in Microsoft SQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM