I don't think this is possible in Oracle as standard, you will need to write a procedure. Although I agree with the previous posters that I think you need to reconsider your design.

Regards