How to display a sys_refcursor data in TOAD's DataGrid

前端 未结 2 749
我寻月下人不归
我寻月下人不归 2021-02-04 13:11

Please i need help. (I SEARCHED A lot and get more confused . )

I use Toad 9.7.25 and i made this procedure (in a package)

PROCEDURE ReportaCC(pfcorte I         


        
2条回答
  •  没有蜡笔的小新
    2021-02-04 13:48

    As your procedure is doing only a select statement better use a function like

    CREATE or REPLACE function ReportaCC(pfcorte IN DATE) 
    RETURN SYS_REFCURSOR
    AS
       lcursor   SYS_REFCURSOR;
    BEGIN
       OPEN lcursor FOR
         select c1, c3, c3 from table1 where hdate = pfcorte;
       RETURN lcursor ;
    END;
    /
    

    Do not close lcursor here, close from your calling statement because if you close lcursor then you wouldn't be able to see any results.

    And execute as

    select ReportaCC(<>) from dual
    

    from toad, double click cursor in datagrid to see the results.

提交回复
热议问题