Can an SQL procedure return a table?

后端 未结 3 772
悲哀的现实
悲哀的现实 2020-12-31 16:33

Can an Oracle SQL procedure return a table? I\'m currently using a dbms_output to print out the outputs of two cursors which are in a loop, although this would

3条回答
  •  北海茫月
    2020-12-31 16:56

    I think that you can use Oracle Cursor for this (if your Oracle version supports it):

    PROCEDURE myprocedure(
        mycursor OUT SYS_REFCURSOR )
    AS
    BEGIN
      OPEN mycursor FOR SELECT * FROM mytable;
    END;
    END;
    

提交回复
热议问题