You can initialize PL/SQL arrays with FOR loops itype constructors from 21c
array := arr_type ( FOR i IN ... )
These can loop through
Values => IN x .. y
A cursor => IN ( SELECT ... )
Use the optional INDEX clause to set custom indices
Try these at buff.ly/J1aH20F