Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ALTER TRIGGER commands inside a procedure?
I have a number of triggers in my database that I wish to have all disabled during data loads, and then re-enabled afterwards. The commands are simple enough:
alter trigger t1 disable;
alter trigger t2 disable;
...
I would like to disable all of these triggers with a single call. (With a similar procedure to turn them back on when the load is finished.) However, I believe ALTER commands fall under the heading of DDL as opposed to DML, and so I can't put them in a procedure:
create procedure prepareForLoad is
begin
alter trigger t1 disable;
alter trigger t2 disable;
...
end;
First question: what commands, exactly, are legal inside PL/SQL blocks? My _Oracle 8: The Complete Reference_ doesn't say. Secondly, is there a way to do what I want here? The only approach I can think of is to stick all these commands in an external file and then do
@file
but I'd much prefer the commands to be built into the schema if possible. Received on Wed Aug 22 2001 - 14:23:01 CDT