Bobby
Bobby

Reputation: 1595

Notification after script has finished in SQL Developer

I'm interested in any method that will notify me once this script has finished execution. It's doing a full load from one database to another and each time it executes, it loads a month of data. Upon completion, I need to start it again after updating a control table to load the next month. The execution time varies due significantly due to varying amounts of data and varying available Oracle resources so simply setting a timer leads to unnecessary checking or lost potential load time.

BEGIN
  PKG_PACKAGENAME.PROCEDURENAME;  
END;

These are my ideas but I don't know what's actually possible to implement without significant external dependencies. The simplest method will be preferred for now. Anything similar is probably also be OK if it can be run within a secure corporate environment. I would prefer not to have to modify the package or procedure contents.

Upvotes: 1

Views: 1872

Answers (3)

René Nyffenegger
René Nyffenegger

Reputation: 40499

If you're running SQL Developer on Windows, use Powershell to instantiate a COM object which can speak:

begin
   dbms_lock.sleep(3);
end;
/

host powershell -c $sapi = new-object -comObject sapi.spVoice ; $sapi.speak('The script has finished')

Upvotes: 1

Alex Poole
Alex Poole

Reputation: 191285

Bring the SQL Developer Window to the front

Really quick and dirty; add an accept to your script after the anonymous block that calls your procedure:

BEGIN
  PKG_PACKAGENAME.PROCEDURENAME;  
END;
/

accept dummy prompt "Script has finished, just press enter"

and run as a script (F5). When the block finishes the substitution variable prompt

SQL Developer accept prompt

steals focus; when you click OK or hit enter (or cancel - it doesn't matter what you do) the main SQL Developer window comes to the front.

Upvotes: 5

psaraj12
psaraj12

Reputation: 5072

Emit an audible notification

chr(7) will produce a beep in SQL*Plus, at least on Windows:Use it after your procedure run

SQL> select chr(7) from dual;

Upvotes: 1

Related Questions