Re: Trigger Length

From: Scott Urman <surman_at_oracle.com>
Date: 1996/04/16
Message-ID: <4l12ij$d5p_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <4l0sdo$26e_at_ams.amsinc.com>, Edward_Hillman_at_mail.amsinc.com (Ed Hillmann) writes:
|> In article <317306EE.1264_at_frontiernet.net>, ekammin_at_frontiernet.net
|> says...
|> >
|> >Does anyone know the maximum length of a trigger? I'm having trouble
|> >with a trigger, and I think the body has exceeded the maximum allowable
|> >size.
|>
|> From my understanding, you want to keep triggers short. In current
|> versions of Oracle7, triggers have to be parsed/compiled/whatever for
|> every user, or something like that. This may change in the future, I
|> believe, but triggers were intended to be short. In training, I was told
|> that if a trigger is 200 lines, its too long.

Triggers are stored in compiled form in 7.3. Thus you don't have to use as many procedures. It's still probably a good idea to keep triggers (and any PL/SQL block, for that matter) reasonably short so that it is easily understandable. Or you can separate it into smaller subroutines.

|>
|> One option that I have used, is to write whatever functionality you can
|> into stored procedures and/or functions. PL/SQL in procedures and
|> functions are stored compiled, so it's less work for the server to use
|> them compared to triggers. That way, the triggers can call the stored
|> precedures, the same functionality can be preserved, the triggers can be
|> as small as necessary.
|>
|> Hope this helps.
|> Ed
|>
 

-- 
Scott Urman
"The opinions expressed here are my own, and are not necessarily that of
 Oracle Corporation"
Received on Tue Apr 16 1996 - 00:00:00 CEST

Original text of this message