通过Oracle的数据库链接运行SQL Server存储过程 [英] Run SQL Server Stored Procedure via Database Link from Oracle

查看:130
本文介绍了通过Oracle的数据库链接运行SQL Server存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参考如何执行Oracle通过数据库链接存储过程,在我的情况下不起作用.我不知道我在想什么.

Referring to How to execute an Oracle stored procedure via a database link, it does not work in my case. I don't know what I am missing.

我在同一台计算机上有一个SQL Server实例和Oracle数据库.然后在Oracle中创建数据库链接,称为ss.

I have a SQL Server instance and Oracle database in the same computer. And database link is created in the Oracle, called ss.

SQL Server中有一个名为dbo.test_proc

And there is a stored procedure in SQL Server called dbo.test_proc

create proc dbo.test_proc
as
    print 'testing';

显然,它没有参数,也没有返回值.

Apparently, it does not have parameter and no return value.

我试图通过数据库链接在Oracle中调用存储过程.但是以下工作没有.

I tried to call the stored procedure in Oracle via database link. But none of the following work.

exec test_proc@ss;
exec "test_proc"@ss;
exec "dbo"."test_proc"@ss;
exec "dbo.test_proc"@ss;
exec "dbo..test_proc"@ss;

错误就像

PLS-00201: identifier 'test_proc@SS' must be declared
ORA-06550: line 1, column 7:

有什么可以帮助我的吗?我已经尝试了很长时间.谢谢!

Could any help me that? I have tried for a long time. Thanks!

上载图像以查询sys.procedures,以检查SQL Server中存储过程的存在并尝试通过数据库链接运行存储过程. 图像

Image is uploaded for querying sys.procedures to check the existence of the stored procedure in SQL Server and trying to run the stored procedure via database link. Image

推荐答案

在Google上搜索了一段时间之后,我终于发现我正在使用 dg4odbc ,它支持在SQL Server中调用存储过程.

After google it for a while, I finally found that I am using dg4odbc which is NOT supporting calling stored procedure in SQL Server.

http://forums.oracle.com/forums/thread.jspa?threadID = 1131396& tstart = 0

但是,我的计算机是Windows 7,因此我仍在寻找解决方案.谢谢!

However, my computer is Windows 7, so I am still looking for solution. Thanks!

更新:jonearles给了我一个棘手的主意,但是它可行.请参阅下面的评论.

Update: jonearles gives me a tricky idea but it works. See the comments below.

这篇关于通过Oracle的数据库链接运行SQL Server存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆