accept answer char prompt 'Type Y or N and press [Return]: '


select 'prompt'
from  dual 
where upper('&answer') = 'Y'
union
select 'start yesno.sql'
from  dual
where nvl(upper('&answer'),'xXx') not in ('Y','N')
union
select 'exit'
from  dual
where upper('&answer') = 'N'

set termout off
set verify off
set heading off
spool tmp.sql
/
spool off
set termout on
set verify on
set heading on

start tmp.sql
