title: Function that would return the data retrieved from a select query - Oracle
body: <p>I am trying to write a function that would return the result of a select query. I have worked with very basic functions that would return a number and a varchar2(string). But now I want to return the result of a select, which would be like 10 rows and their corresponding columns.</p>
  
  <p>How would I write the function and what would the return type be?</p>
  
  <p>An example function that I have written is:</p>
  
  <blockquote>
    <p>create or replace function func1
    return varchar2 as   begin
        return('hello from func1');   end func1;</p>
  </blockquote>
  
  <p>I am still at a basic level, so can anybody help me out with returning the result of a select query? I believe cursors are to be used, as there would be more than one row.</p>