Andreas Goldstein wrote : 
>
>Hi Listmembers,
>
>I created the following table and used it without problems. 
>Later I add the
>two trigger shown below. Since I added the trigger I have to enter all
>Insert- and Update-statements two times before they take 
>effect? This can be
>noticed inside my VB-DB-Application as well as by using the SQL Studio.
>MaxDB: 7.6.00.12 on Windows XP
>
>Is it a problem with the trigger-definition or a bug?
>
>
>CREATE TABLE WWIND.KUNDEN (
>KundenCode     CHAR(5)      PRIMARY KEY,
>Firma         VARCHAR(40)  NOT NULL,
>Kontaktperson  VARCHAR(30),
>Funktion       VARCHAR(30),
>Strasse        VARCHAR(60) NOT NULL,
>Ort            VARCHAR(15) NOT NULL,
>PLZ            VARCHAR(10) NOT NULL,
>Land           VARCHAR(15) NOT NULL,
>Telefon        VARCHAR(24),
>Telefax        VARCHAR(24))
>//
>CREATE TRIGGER it_kontaktinfo FOR WWIND.KUNDEN AFTER INSERT EXECUTE (
>IF ((LENGTH(kontaktperson) = 0) AND (LENGTH(funktion) > 0))
>THEN STOP (30001, 'Funktion ohne Kontaktperson ist nicht erlaubt');)
>//
>CREATE TRIGGER ut_kontaktinfo FOR WWIND.KUNDEN AFTER UPDATE EXECUTE (
>IF ((LENGTH(NEW.Kontaktperson) = 0) AND (LENGTH(NEW.Funktion) > 0))
> THEN STOP (30002, 'Funktion ohne Kontaktperson ist nicht erlaubt');)
>
>-- 
>Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
>Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
>
>-- 
>MaxDB Discussion Mailing List
>For list archives: http://lists.mysql.com/maxdb
>To unsubscribe:    
>http://lists.mysql.com/maxdb?>[EMAIL PROTECTED]
>
>

This is a bug that has to do with the implementation of the length function. We 
will fix it as soon as possible.
As a workaround you could try to do without the length function :

CREATE TRIGGER it_kontaktinfo FOR WWIND.KUNDEN AFTER INSERT EXECUTE (
if (kontaktperson is null) OR (kontaktperson = ' ') OR 
   (funktion is null) OR (funktion = ' ')
THEN STOP (30001, 'Funktion ohne Kontaktperson ist nicht erlaubt');)

Best Regards,
Thomas

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to