3 Replies Latest reply on Jun 14, 2018 1:10 PM by Mike Kutz

    Can a Package function return table?

    3558023

      Hi all,

       

      I got a set of data to display in a crystal report; But before the raw data be able to shown in crystal report, I have to massage the data via logic with insert and update statements to form my result table.

       

      From MS SQL Server, there are stored procedure which I can write my own logic to interact with Tables or Values and if I end the stored procedure by a select statement, the SP can return the table result for me.

       

      I knew that in Oracle, package act like stored procedure in MS SQL Server, but I dont know how to define the return type as a table in a package function....

       

      I found the following materials for reference:

      https://stackoverflow.com/questions/2829880/create-an-oracle-function-that-returns-a-table

       

      But I only can get only 1 row, if i modified the SELECT statement that collect more than one row, the package can be compile but when I execute It will prompt error and said there are more than one row in result.

       

      I also tried to use cursor and loop it, but still not working; May I ask can you guys give me some advise or help please?