Hmm. I'm just learning SQL, so I don't understand all of the second response, but I think I get the basic idea. I'm not sure if this will work with PL/SQL, but there was no PL/SQL forum, so this was as close as I could get. If all of this is not possible in PL/SQL, I'm sorry to have bothered you.