Condition based spool generation in Oracle SQL script
问题 I have a scenario where we generate spool based on condition. The spool should generate only if user types y. column col noprint new_value elcm_script select decode(lower('&gen'),'y','C:\ELCM.SQL','n', 'null') col from dual; SPOOL c:\ELCM_DETAILS.SPL @&elcm_script spool off In the above it will generate spool file even if user type n like error reading file.. How to stop generating the spool if n.or how to remove spool which is generated/ 回答1: If you can put this controlling section into its