1

I am trying to run an Oracle stored procedure using linked server on SQL Server.

Stored procedure is crs.uf and it accepts a parameter p_date.

From SQL Server, I am executing it like this:

EXECUTE ('begin crs.uf("2016-02-26"); end;') AT LServer

I'm getting this error:

OLE DB provider "OraOLEDB.Oracle" for linked server "LServer" returned message "ORA-06550: line 1, column 47:

PLS-00201: identifier '2016-06-26' must be declared
ORA-06550: line 1, column 7:

PL/SQL: Statement ignored".

Msg 7215, Level 17, State 1, Line 2
Could not execute statement on remote server 'LServer'.

What am I doing wrong? How to successfully run this stored procedure?

1 Answer 1

1

Try

 DECLARE @dateval DATETIME

    EXECUTE ('begin crs.uf(?); end;',@dateval) AT LServer
Sign up to request clarification or add additional context in comments.

2 Comments

Just Curious! How to pass more than one argument?
EXECUTE ('begin crs.uf(?,?); end;',@dateva1,@dateval2) AT LServer

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.