title: bind in and out parameters to anonymous pl/sql
body: <p>I have a problem which I cant seem to find if Oracle allows it or not. I have an anonymous PL/SQL block which intends to do a </p>
  
  <ol>
  <li>SELECT using some WHERE clauses in which values are not fixed but determined at runtime</li>
  <li>then from a set of rows returned it picks one which matches and UPDATES it.</li>
  <li>Finally the intention is to pass the UPDATED rows columns back to the application</li>
  </ol>
  
  <p>I am not fully sure how to </p>
  
  <p>a_ pass parameters/bind variables into an "<strong>anonymous</strong> PL/SQL block<br>
  b_ get a row or even an id back from the <strong>anonymous</strong> PL/SQL block (step 3 above).</p>
  
  <p>While I get that it is possible to do for a named stored procedure or function - I am getting unclear response if a and b are possible for an <strong>anonymous</strong> pl/sql. </p>
  
  <p>Here is a representative code:</p>
  
  <pre><code>DECLARE
       n1 NUMBER ;
       n2 NUMBER ;
       rid UROWID;
       CURSOR c IS SELECT rowid from MY_TABLE WHERE colA= n1;
       row MY_TABLE%ROWTYPE;
  
  BEGIN
     OPEN c;  
     FETCH c INTO rid;
     LOOP
         SELECT * INTO row FROM MY_TABLE where rowid=rid FOR UPDATE;
         IF SQL%NOTFOUND THEN
            CONTINUE;
         ELSE
            UPDATE MY_TABLE SET colZ= n2 WHERE rowid = rid;
            IF SQL%ROWCOUNT = 1 THEN
                   // need to return  value of row back to application
            END IF;
         END IF;
     END LOOP;
  END;
  </code></pre>
  
  <p>Here is what I am looking for (specifically for anonymous pl/sql)
   - I am looking for n1 and n2 to be set as bind variables or input arguments by the calling application. 
   - Also I am looking if the row updated can be sent back after pl/sql block execution.</p>