title: PL/SQL Cursor for loop
body: <p>I believe I need a cursor for loop to go through the street1 column from table test_data. I have a program which needs to test each row from the table.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>cursor c1 is
  street1
  from test_data
  
  Begin
      If Instr(street1, ‘Cnr’, 1) &gt;= 1;
      Then
          Newstreetname := Substr(street1, Instr(street1, ‘Cnr’, 1)+3);
      Else if
          Instr(street1, ‘PO Box’, 1) &gt;= 1;
      Then
          Newstreetname:= Substr(street1, Instr(street1, ‘PO Box’, 1));
      Else if
          REGEXP_ Instr (street1, [\d], 1) = 0; 
      Then
          Newstreetname:= street1;
      Else if
          REGEXP_ Instr (street1, [\d], 1) &gt;= 1;
      Then
          Newstreetnumber:= regexp_substr(street1, '\d+(\s|\/)(\d+)?-?(\d+)?(\w {1})?'); 
          Newstreetname:= regexp_substr(street1, '(\w+\s\w+)$'); 
  End
  </code></pre>