home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!welchgate.welch.jhu.edu!oscar.welch.jhu.edu!ken
- From: ken@oscar.welch.jhu.edu (Ken Fasman)
- Subject: Re: Recursive Triggers ?
- Message-ID: <1993Jan22.025650.26799@welchgate.welch.jhu.edu>
- Followup-To: comp.databases.sybase
- Summary: No, sorry
- Keywords: triggers
- Sender: Ken Fasman
- Nntp-Posting-Host: oscar.welch.jhu.edu
- Organization: Genome Data Base, Johns Hopkins University
- References: <1jh22bINNmhn@meaddata.meaddata.com>
- Date: Fri, 22 Jan 1993 02:56:50 GMT
- Lines: 30
-
- In article <1jh22bINNmhn@meaddata.meaddata.com> hth@meaddata.com (Hirendra Hindocha) writes:
- >I have a hierarchical database structure. What I wanted to do was -
- >an insert,update or a delete in a table should fire off a trigger which
- >would perform some calculations for the hierarchy above the inserted one.
- >i.e a change affecting a child should start off a trigger , which would
- >then update the parent in the same table. Now since this is again an
- >update, this should again start off the trigger to update the parent's
- >parent and so on , till it reaches the top of the tree.
- >
- >Is it possible to do this ? If it is , please let me know how ?
- >I tried a trigger , but that seems to be updating , only one level up.
- >It does not propagate all the way up the hierarchy as I expected.
-
- Sybase triggers cannot accomodate recursive operations, since they will not
- fire more than once on the same insert/update/delete. You must figure out
- a way to accomplish the same task programmatically in one pass of the
- trigger.
-
- Triggers on one table can cause triggers on other tables to fire, if the
- nested triggers configuration variable is set to 1. They can also invoke
- stored procedures. The total number of trigger and stored procedure calls
- on the stack (the "nesting level") must not exceed 16.
-
- Ken Fasman,
- Genome Data Base
- Johns Hopkins University School of Medicine
- 2024 E. Monument St.
- Baltimore MD 21205
-
- ken@library.welch.jhu.edu
-