Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> ALTER TRIGGER commands inside a procedure?

ALTER TRIGGER commands inside a procedure?

From: Paul Brinkley <laugh_at_starpower.net>
Date: Wed, 22 Aug 2001 19:23:01 GMT
Message-ID: <3b84061d.761585582@news.starpower.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US