Dusan Kolesar wrote: > > > Hello, > > I have one problematic trigger. > When I insert into LEVEL table, all database instance crash down. > When there is the same trigger but without 2 lines: > line 16 and 31 is EXECUTE insertstmt; > everything is running and in the debug table TEST I can see > all correct > insert statemants. > Trigger is also running when there is only one prat of it (parts are > separated by empty line). > Can you help me, please. What am I doing wrong? > > Regards, Dusan
You told us that after inserting into LEVEL, the database crashes. But you send us an update trigger, not fired after insert. Where is the mistake? Are we looking onto the needed info? Which version do you use? How does the traceback look like? Are we talking about ASCII or Unicode-database? Can you provide a vtrace according to http://sapdb.2scale.net/moin.cgi/VTrace Elke SAP Labs Berlin > > CREATE TRIGGER LEVEL_UPDATE FOR LEVEL AFTER UPDATE EXECUTE > ( > VAR > tbname Char (100); > insertstmt Char (300); > addrid Integer; > levval Integer; > > DECLARE TAB CURSOR FOR SELECT EVENTTBNAME FROM > ADMIN.FLEET_USER WHERE > ISCONNECTED <> 0; > WHILE $rc = 0 DO > BEGIN > FETCH TAB INTO :tbname; > IF $rc = 0 THEN > BEGIN > insertstmt = 'INSERT ADMIN.' || tbname || ' (TABLEID, OBJID, > ACTIONID) VALUES (1, ' || CHR (OLD.ID) || ', 2)'; > EXECUTE insertstmt; // line 16 > insert admin.test set txt = :insertstmt; > END; > END; > > IF (NEW.DESCR <> OLD.DESCR) THEN > BEGIN > DECLARE ADDR CURSOR FOR SELECT ADDRESS.ID, > FLEET_USER.EVENTTBNAME > FROM ADMIN.ADDRESS, ADMIN.FLEET_USER WHERE ADDRESS.LEVEL = > :NEW.LEVEL AND > FLEET_USER.ISCONNECTED <> 0 ; > WHILE $rc = 0 DO > BEGIN > FETCH ADDR INTO :addrid, :tbname; > IF $rc = 0 THEN > BEGIN > insertstmt = 'INSERT ADMIN.' || tbname || ' > (TABLEID, OBJID, > ACTIONID) VALUES (2, ' || CHR (addrid) || ', 2)'; > EXECUTE insertstmt; // line 31 > insert admin.test set txt = :insertstmt; > END; > END; > END; > ) > > > -- > MaxDB Discussion Mailing List > For list archives: http://lists.mysql.com/maxdb > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
