Home » RDBMS Server » Networking and Gateways » Calling Transact SQL stored procedure via Transparent Gateway
Calling Transact SQL stored procedure via Transparent Gateway [message #47078] Wed, 21 July 2004 05:01 Go to next message
Elena
Messages: 14
Registered: December 2000
Junior Member
I have SQL stored procedure dbo.dajOznakaVal with input parametar (integer) and output parametar (char)

CREATE PROCEDURE dbo.DajOznakaVal @valuta int
AS
select oznaka from valuti (nolock) where sifra=@valuta
GO



The table VALUTI has records SIFRA type char(3) and OZNAKA type char(3).

 

When I try to execute exec dbo.dajOznakaVal@testlink(978) using the PL/SQL command window I keep receiving the following message:

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'DAJOZNAKAVAL'
ORA-06550: line 1, column 7:

 

But when try the select oznaka from valuti@testlink where sifra=978 in the PL/SQL SQL window I have the correct result EUR!

For establishing the database connection and setting the parametars in the initial files I was using the book ‘Oracle Transparent Gateway for Microsoft SQL Server”!
Re: Calling Transact SQL stored procedure via Transparent Gateway [message #47080 is a reply to message #47078] Wed, 21 July 2004 10:39 Go to previous messageGo to next message
Tak Tang
Messages: 142
Registered: May 2004
Senior Member
Well, I dont know SQL Server, but try this, and tell us what oracle says :-

describe dbo.dajOznakaVal@testlink
Re: Calling Transact SQL stored procedure via Transparent Gateway [message #47084 is a reply to message #47080] Wed, 21 July 2004 22:31 Go to previous messageGo to next message
Elena
Messages: 14
Registered: December 2000
Junior Member
SQL> describe dbo.DajOznakaVal@test6;
PROCEDURE jOznakaVal@test6
Argument Name Type In/O
------------------------------ ----------------------- ----
@valuta NUMBER(10) IN
result_set_handle REF CURSOR OUT
Re: Calling Transact SQL stored procedure via Transparent Gateway [message #47088 is a reply to message #47084] Thu, 22 July 2004 00:37 Go to previous messageGo to next message
Tak Tang
Messages: 142
Registered: May 2004
Senior Member
Elena,

Thats really cool! I didn't realise Oracle was that savvy. Try this from SQL*Plus :-
VARIABLE r REFCRUSOR

EXEC dbo.dajOznakaVal@testlink(978, :r);

PRINT r


Refcursors are quite a big (and very cool) subject - more so than I can do justice to. I noticed that you also posted this question on Oracle Technology Network. If you post the description there, you'll get lots and lots of help on refcursors.

Tak
Re: Calling Transact SQL stored procedure via Transparent Gateway [message #47092 is a reply to message #47088] Thu, 22 July 2004 01:16 Go to previous messageGo to next message
Elena
Messages: 14
Registered: December 2000
Junior Member
Dear Tak,

Thank you so much for your help!
However, I have another error with poor description:

SQL> variable r refcursor

SQL> exec dbo.dajOznakaVal@test6(978,:r);
BEGIN dbo.dajOznakaVal@test6(978,:r); END;

*
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[[Transparent gateway for MSSQL]]
ORA-06512: at line 1
Re: Calling Transact SQL stored procedure via Transparent Gateway [message #47099 is a reply to message #47092] Thu, 22 July 2004 11:11 Go to previous message
Tak Tang
Messages: 142
Registered: May 2004
Senior Member
Elena,

I'm afraid I dont know.

You might be able to find someone with experience with TG4MSSQL and SQL Server on the Hetrogeneous Connectivity forum on OTN.

Takmeister
Previous Topic: client server question
Next Topic: ORA-12640
Goto Forum:
  


Current Time: Wed May 01 02:23:38 CDT 2024