Have you thought about using PL/SQL collections instead?