-
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.
There Nothing You cannot Do, The problem is HOW.
-
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;
-amar
-
Thanks, but I am looking to run an external program. (ie, cmd.exe, explorer.exe, etc..) Is there a "not so complicated" way to do that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|