title: Display a table inside an Oracle procedure
body: <p><em>I'm on Oracle DB 12c and using SQL Developer.</em></p>
  
  <p>How can I display every rows of a table inside a procedure, if all arguments are "null".</p>
  
  <p>I'm guessing that my IF is correct and I might have seen two or three posts where they used cursors but I'm not very familiar with the utilization of those.</p>
  
  <p>I would like it to basically be a <strong>SELECT * FROM Salle</strong> but with a condition.</p>
  
  <p>Am I on the right track here ?</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE Foo1 (noSalle in varchar2, Cat in varchar2, Nb in number)
  IS
   cursor SYS_REFCURSOR; -- Not sure at all about that
  
  BEGIN
    DBMS_OUTPUT.PUT_LINE('Salle : ' || noSalle || 'Cat : ' || Cat);
    IF (noSalle = null AND Cat = null AND Nb = null) THEN
      OPEN cursor FOR 
        SELECT * from Salle;     
  
    -- Some sort of FOR row IN cursor LOOP ?
    -- Display ALL rows of "Salle"
  
    END IF;
  
  EXCEPTION 
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Erreur Oracle : '||sqlcode||' ; Message Oracle : '||sqlerrm);
  END;
  </code></pre>