Icon View Incident Report

Serious Serious
Reported By: Jim Garrity
Reported On: 4/14/2008
For: Version 1.09 Build 1
# 2601 Triggers That Update Their Source Table Cause Access Violation

I'm getting an access violation during a TEDBTable.Post operation with the following trigger.

create trigger trigUpdateFlags After Update of Residence, Mailing, Billing,
Shipping
   ON Address
BEGIN
  DECLARE AddressCursor CURSOR for Stmt;
   DECLARE Res bool DEFAULT false;

   PREPARE Stmt FROM 'SELECT * FROM Address where Owner_ID = ? and
Owner_Type = ?';

   OPEN AddressCursor using OldRow.Owner_ID, OldRow.Owner_Type;

   FETCH FIRST FROM AddressCursor (Residence) INTO Res;

   WHILE NOT EOF(AddressCursor) DO
      IF (Res=true) THEN
         UPDATE AddressCursor SET Residence=false;
      END IF;
      FETCH NEXT FROM AddressCursor (Residence) INTO Res;
   END WHILE;
END



Comments Comments
The issue was the fact that the trigger is updating the table for which it is defined.


Resolution Resolution
Fixed Problem on 4/15/2008 in version 1.09 build 2


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image