I need a simple example of an Oracle stored procedure that returns a result set. I didn't find out how to return the result set to the SQL Server. What I have now is:
On Oracle:
CREATE OR REPLACE PROCEDURE sp_sessions (cursorParam OUT SYS_REFCURSOR)
IS
BEGIN
OPEN cursorParam FOR select * from v$session;
END;
/
running on sql plus:
variable rc refcursor;
exec OR_WebI_SmartLinkMetrics( :rc );
print rc;
On SQL Server it should be something like:
SELECT * FROM OPENQUERY(LocalOracle, '{CALL sp_sessions(......)');
Is this possible? I was thinking to use temporary tables?