PL/SQL (MOSC)

MOSC Banner

call a procedure on a remote db using db. link

in PL/SQL (MOSC) 3 commentsAnswered

Oracle db. 18c.

Hi,

Trying to execute a stored procedure on MS SQL server with multiple parameters, on oracle side using pl/sql.

I can access tables, select, insert, etc.. But not able to run a remote stored procedure.

exec remote_prc@mydblink

Working

from Oracle pl/sql:

set echo on;

set serveroutput on;

DECLARE

 c INTEGER;

 R1 INTEGER;

 SOUT varchar2(100);

 C1 INTEGER;

BEGIN

 c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@dblink;

 DBMS_HS_PASSTHROUGH.PARSE@dblink(c,'EXEC remote_prc[something]');

 LOOP

 R1 := DBMS_HS_PASSTHROUGH.FETCH_ROW@dblink (c);

 EXIT WHEN R1 = 0;

 DBMS_HS_PASSTHROUGH.GET_VALUE@dblink (c, 1, SOUT);

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center