Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 64940 invoked from network); 7 May 2009 21:27:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 May 2009 21:27:08 -0000 Received: (qmail 45358 invoked by uid 500); 7 May 2009 21:27:07 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45307 invoked by uid 500); 7 May 2009 21:27:07 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45298 invoked by uid 99); 7 May 2009 21:27:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 21:27:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 21:27:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 93CF5234C044 for ; Thu, 7 May 2009 14:26:45 -0700 (PDT) Message-ID: <1031131128.1241731605603.JavaMail.jira@brutus> Date: Thu, 7 May 2009 14:26:45 -0700 (PDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-172) Improve documentation for BEFORE triggers In-Reply-To: <84272775.1110499855493.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kathey Marsden updated DERBY-172: --------------------------------- Summary: Improve documentation for BEFORE triggers (was: Trigger activation) Changing title to better reflect the user request for better documentation for BEFORE triggers. > Improve documentation for BEFORE triggers > ----------------------------------------- > > Key: DERBY-172 > URL: https://issues.apache.org/jira/browse/DERBY-172 > Project: Derby > Issue Type: Bug > Components: Documentation > Affects Versions: 10.0.2.0 > Environment: Windows XP SP1 Windows > Reporter: George Baklarz > Priority: Minor > > I image that this is a documentation problem. The "words" around triggers seem to imply the ability to do actions "BEFORE" the INSERT/UPDATE/DELETE. For instance: > "Along with constraints, triggers can help enforce data integrity rules with actions such as cascading deletes or updates. Triggers can also perform a variety of functions such as issuing alerts, updating other tables, sending e-mail, and other useful actions." > Well, the CREATE TRIGGER command only allows AFTER as an option (even though the SYSTRIGGERS catalog uses "B" for before and "A" for after) and it won't allow a CALL statement to be processed. Seems to me that there aren't any ways to send an e-mail, issue alerts (no SIGNAL function either), or enforce integrity rules. How can you enforce integrity rules if invalid data comes in? I can't force a SIGNAL or error with the trigger, so this is useless for validating changes to the data. > In addition, there appears to be some logic regarding BEFORE triggers in Derby, but its not currently working. > CREATE TRIGGER CB NO CASCADE BEFORE > INSERT ON BONUSES > REFERENCING NEW AS n > FOR EACH ROW MODE DB2SQL > UPDATE BONUSES > SET BONUS = > CASE > WHEN (n.BONUS = 0) THEN 100 > ELSE n.BONUS > END; > ERROR 42Z9D: 'UPDATE' statements are not allowed in 'BEFORE' triggers. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.