SSRS executing a Stored Procedure in Oracle

后端 未结 1 1902
长情又很酷
长情又很酷 2021-01-16 14:39

I have a Report in SSRS VS2008 that needs to run a Stord Procedure from Oracle. In the past I have run functions from Oracle that return tables in order to display the data

相关标签:
1条回答
  • 2021-01-16 14:55

    Create a stored procedure with an output parameter of type SYS_REFCURSOR, and place the results of the query in the output cursor within the procedure - like so:

    CREATE OR REPLACE PROCEDURE pr_myproc(L_CURSOR out SYS_REFCURSOR) 
    is
       BEGIN
         OPEN L_CURSOR FOR
           SELECT * FROM mytable;
       END;
    

    Then create the dataset in your report - on the Query tab, set the Command type to StoredProcedure, and the Query string to the name of the procedure, eg. pr_myproc. If you check the fields tab, these should match the expected structure of the cursor, ie. the query output.

    0 讨论(0)
提交回复
热议问题