oh also. this might require a lot more work, but look into use Pro*C for something like this, it might also provide performance gains over PL/SQL.