OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
RE: [FSID] Delete-Trigger problem

From: Andreas Goldstein (accountistnurzumleerengedachtgmx.li)
Date: Tue Aug 16 2005 - 17:36:42 CDT


OK, I got it! ;)

As I searched in the deep of this mailinglist I found the solution to this
issue:
http://lists.mysql.com/maxdb/5178 (February 20 2002 12:54pm)

What is stated there is, that only UPDATE-TRIGGER will have NEW and OLD, so
for my purposes I have to modify my trigger as follows:

CREATE TRIGGER customerdeletion FOR customer AFTER DELETE EXECUTE (
TRY
  IF addressID IS NOT NULL
    THEN DELETE FROM address WHERE <schema>.address_id = :OLD.addressID;
  IF invoiceaddressID IS NOT NULL
    THEN DELETE FROM address WHERE <schema>.address_ID =
:OLD.invoiceaddressID;
CATCH
  IF $rc <> 100
    THEN STOP ($rc, 'Customer deletion failed');
)

I find it very inconsistent not to make NEW.<columnname> available when
:NEW.<columnname> have to be used inside SQL-statements. Although the
documentation should be changed ASAP, as it is very annoying to work with
MaxDB when the reference states wrong information. Unfortunately there are
only a few sources that can be used instead of the reference so it is more
important to have a reliable source of information on hands ;)

--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb