Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21E8BCDD2 for ; Wed, 17 Dec 2014 18:49:14 +0000 (UTC) Received: (qmail 86600 invoked by uid 500); 17 Dec 2014 18:49:14 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 86579 invoked by uid 500); 17 Dec 2014 18:49:14 -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 86568 invoked by uid 99); 17 Dec 2014 18:49:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2014 18:49:13 +0000 Date: Wed, 17 Dec 2014 18:49:13 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6783) WHEN clause in CREATE TRIGGER for UPDATE is not working for the sql script below MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250299#comment-14250299 ] Mamta A. Satoor commented on DERBY-6783: ---------------------------------------- WHEN clause was added in release 10.11 so this issue is specific to 10.11. > WHEN clause in CREATE TRIGGER for UPDATE is not working for the sql script below > -------------------------------------------------------------------------------- > > Key: DERBY-6783 > URL: https://issues.apache.org/jira/browse/DERBY-6783 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.11.1.1 > Reporter: Mamta A. Satoor > > Following sql script was shared on derby-user(http://mail-archives.apache.org/mod_mbox/db-derby-user/201412.mbox/%3c548ABA6D.8000509@zoho.com%3e). > The UPDATE TRIGGER with the WHEN clause below does not fire as expected. Same script works fine on DB2. > ij version 10.11 > ij> connect 'jdbc:derby:MyDbTest;create=true'; > ij> CREATE TABLE t1 (id INTEGER, done_date DATE, status CHAR(1)); > 0 rows inserted/updated/deleted > ij> CREATE TRIGGER tr1 AFTER UPDATE OF status ON t1 REFERENCING NEW AS newrow FOR EACH ROW WHEN (newrow.status='d') UPDATE t1 SET done_date=current_date WHERE id=newrow.id; > 0 rows inserted/updated/deleted > ij> insert into t1 values (1, null, 'a'); > 1 row inserted/updated/deleted > ij> SELECT * FROM t1; > ID |DONE_DATE |STA& > --------------------------- > 1 |NULL |a > > 1 row selected > ij> UPDATE t1 SET status='d'; > 1 row inserted/updated/deleted > ij> SELECT * FROM t1; > ID |DONE_DATE |STA& > --------------------------- > 1 |NULL |d > > 1 row selected > ij> exit; -- This message was sent by Atlassian JIRA (v6.3.4#6332)