Has anybody been able to execute a program on the database server from an Oracle trigger?
I have a table that when updated the users want a program to execute. I can exeute the program from a command line, but is there a way to get the trigger to execute something from the command line?
If by program you mean executing a pl/sql stored procedure, You can surely do that with exeception that there should not be any commit in the procedure.
and if you mean external program, just make a search on this forum about how to call external programs from Oracle, there have been some threads about that )
Originally posted by sudip If by program you mean executing a pl/sql stored procedure, You can surely do that with exeception that there should not be any commit in the procedure.
Just an update
You can have COMMIT statements within a stored procedure called from a trigger in 8i and above. The follownig code snippet is perfectly valid:
create or replace trigger emptest
before insert on emp
for each row
declare
PRAGMA AUTONOMOUS_TRANSACTION;
-- this pragma allows us to have commits!
begin
testinsert(:new.empno, :new.ename);
-- testinsert is the SP containing the COMMIT
end emptest;
create or replace procedure Testinsert(empno in number, ename in varchar2) is
begin
INSERT INTO TT1 (EMPNO, ENAME) VALUES (empno, ename);
COMMIT;
end Testinsert;
Bookmarks