Posted By

geekzspot on 02/20/13


Tagged


Versions (?)

Oracle Loop through an Array


 / Published in: PL/SQL
 

Loop through a fixed list of values or strings

  1. TYPE string_array IS TABLE OF VARCHAR(1);
  2. rainbow_colors string_array := string_array('Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet');
  3. FOR i IN 1..rainbow_colors .COUNT LOOP
  4. DBMS_OUTPUT.PUT_LINE(rainbow_colors (i));

Report this snippet  

You need to login to post a comment.