set echo on
spool (file name you need)
select ___
from ____
where ____
spool off

now, look for the file