Declaration and Traversal of Arrays in Oracle Stored Procedures

-- declare array
TYPE V_ARRAY_TABLE IS TABLE OF VARCHAR2(300);
V_ARRAY V_ARRAY_TABLE := V_ARRAY_TABLE('aaa','bbb');


-- loop through the array
FOR i in 1..V_ARRAY.count LOOP
  DBMS_OUTPUT.PUT_LINE(V_ARRAY(i))
END LOOP;


Note: The array must be declared, the array in oracle is a table;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326267859&siteId=291194637