2

I have Oracle linked server in my SQL Server. I created procedure which executes a stored procedure in Oracle:

CREATE PROCEDURE ModifySth (
    @var1 nvarchar(255),
    @var2 nvarchar(255)
)
AS
BEGIN
    DECLARE @var3 as NVARCHAR(255);
    EXEC('begin oracleSPname(?, ?, ? ); end;',
            @var1 output,        
            @var2,
            @var3 output,
        )
    at ORACLE
    SELECT @var1 as var1, @Vvar3 as var3;
END

When I execute ModifySth I am passing two parameters and excepting two output vars. var1 is IN OUT. How to capture var1? When I am trying to capture is, I get value which I passed to the stored procedure, not the output value.

1 Answer 1

1

Why don't you use an extra variable?

DECLARE @var1_reply as NVARCHAR(255);

EXEC('begin oracleSPname(?, ?, ?, ? ); end;',
        @var1,        
        @var1_reply output,
        @var2,
        @var3 output,
    )
at ORACLE

set @var1= @var1_reply;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.