1

If I accidentally Close the sqlplus console of Oracle How I can create some trigger in order to stop the spooling and save the complete data untill that moment in the mentioned spool file.

Ddevil Prasad
  • 117
  • 1
  • 14
  • 1
    If you have a trigger like that, and then you close the SQL\*Plus console, how will the trigger know that you **accidentally** closed it (and not on purpose)? –  Nov 22 '20 at 16:17
  • So can we have a trigger to stop spooling whenever the console closes (on purpose or intentionally). – Ddevil Prasad Nov 22 '20 at 16:20
  • Huh?? there is no such thing. – OldProgrammer Nov 23 '20 at 00:08
  • 1
    This is possible if you do not run sqlplus directly, but through a program that calls sqlplus. And the sqlplus output is written to a file, without using spool on. for example here https://github.com/dmitrydemin1973/powershell-oracle/blob/master/run_all_sql_dir.ps1. – Dmitry Demin Nov 23 '20 at 02:45

0 Answers0