- 自定義數組
聲明數組類型 arr_type
type arr_type is table of NUMBER(20);
聲明數組變量 arr_val
arr_val arr_type;
- 數組賦值
數組賦值(bulk collect into關鍵字是將查詢結果封裝成集合)
select a bulk collect into arr_val from mytable;
- 數組取值
數組取值
for i in 1 .. arr_val.count loop
--處理邏輯
arr_val(i);
end loop;