Home » RDBMS Server » Networking and Gateways » Calling Transact SQL stored procedures via Oracle Transaprent Gateway
Calling Transact SQL stored procedures via Oracle Transaprent Gateway [message #13644] Wed, 21 July 2004 02:40 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 procedures via Oracle Transaprent Gateway [message #13652 is a reply to message #13644] Wed, 21 July 2004 03:59 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9100
Registered: November 2002
Location: California, USA
Senior Member
In pl/sql it would be like this:

scott@ORA92> create table valuti
  2    (sifra char(3),
  3  	oznaka char(3))
  4  /

Table created.

scott@ORA92> insert into valuti values ('978', 'abc')
  2  /

1 row created.

scott@ORA92> CREATE OR REPLACE PROCEDURE DajOznakaVal
  2    (p_valuta IN INTEGER)
  3  AS
  4    v_oznaka valuti.oznaka%TYPE;
  5  BEGIN
  6    SELECT oznaka INTO v_oznaka FROM valuti WHERE sifra = p_valuta;
  7    DBMS_OUTPUT.PUT_LINE (v_oznaka);
  8  END DajoznakaVal;
  9  /

Procedure created.

scott@ORA92> SHOW ERRORS
No errors.
scott@ORA92> SET SERVEROUTPUT ON
scott@ORA92> EXECUTE Dajoznakaval (978)
abc

PL/SQL procedure successfully completed.
Re: Calling Transact SQL stored procedures via Oracle Transaprent Gateway [message #13654 is a reply to message #13652] Wed, 21 July 2004 04:41 Go to previous message
Elena
Messages: 14
Registered: December 2000
Junior Member
Dear Barbara,

I already have a table and created stored procedure on SQl side, all I have to do is call that procedure via database link in Oracle. I'm using Oracle Transparent Gateways as a link beetwn Oracle and SQL server.
Previous Topic: ORA-12154: TNS:could not resolve service name
Next Topic: unexpected error
Goto Forum:
  


Current Time: Sun Nov 24 22:33:31 CST 2024