Link to home
Start Free TrialLog in
Avatar of tcorigli
tcorigli

asked on

How to execute a command on the command line of a Windows OS through a Oracle DB Trigger?

Can anyone please show me how I can execuate a command on the command line of a Windows OS through an Oracle DB Triggger.

Thanks in advanced.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
using plsql you can't do this.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>using plsql you can't do this.

You can with the Java wrapper.  Just not natively using only PL/SQL.
ya that what I am saying......"you can't do it with plsql"

other ways:-
java
proc
etc...
Hi,
You need to be very careful if you do that, calling someting non-transactional fron a trigger.
What if the statement rolls back for any reason ? Then command that has been called will not roll back its effects.
And for internal reasons, a trigger can fire twice for the same update.
Regards,
Franck.
I cannot agree more with franckpachot about the potential problems.

That said, I was researching an answer to another question and came across something I had forgotten.  Depending on your version, DBMS_SCHEDULER can execute an OS program.

Check the docs for job_type EXECUTABLE

http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sched.htm

I've never tried this but in theory you should be able to create the job then start it from the trigger.
Avatar of tcorigli

ASKER

I've requested that this question be deleted for the following reason:

not needed anymore
Just because you don't need this anymore doesn't mean we did not answer your question.

Please post your final solution and if it wasn't covered here, I'll retract my objection.
I suggest:
accept:  http:#a35737139
assist:   http:#a35742522
assist:   http:#a35740796