-
hi guys,
i hv a question, can we call a trigger in procedure, if so, one example please.
thanks
ram
-
triggers aren't called. They execute automatically in response to database events.
Have you considered having your trigger call a procedure that does the functionality, and then calling that procedure from your other locations also?
such as;
create or replace procedure myproc as
begin
insert into mytable2 values('X');
end;
/
create or replace trigger mytrigger before insert on mytable1 for each row
begin
myproc;
end;
/
Then the procedure fires every time the trigger fires, and if you want to call it otherwise, you can just execute it directly.
-
Originally posted by kmesser
triggers aren't called. They execute automatically in response to database events.
Have you considered having your trigger call a procedure that does the functionality, and then calling that procedure from your other locations also?
such as;
create or replace procedure myproc as
begin
insert into mytable2 values('X');
end;
/
create or replace trigger mytrigger before insert on mytable1 for each row
begin
myproc;
end;
/
Then the procedure fires every time the trigger fires, and if you want to call it otherwise, you can just execute it directly.
thanks kmesser
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
|