Assuming you want to run this query thru SQL*Plus, you can consider Communicating with the User.