We recently created two SQL triggers to insert a record into a table. One is
configured to run AFTER INSERT, and the other AFTER UPDATE. The "Include
VALUES (__old and __new) tables", "Include memo and blob data in VALUES
tables", and "Use implicit transactions to maintain data integrity" check
boxes are all checked.

The SQL (attached) is identical for both.

The trigger executres fine when a new record is inserted into the original
table. However, when a record is updated, we receive the following error:

Error 5177: Trigger execution failed.
Error 5068: There is no current record.

We've looked through the help and knowedge base and haven't been able to
identify the cause.

This occurs using both ALS on a test database and on a production database
running ADS 9.1.

Can someone shed some light on what the 5068 error actually means?

Thanks in advance,

A.J. van de Ven

// __new identifies tblCustomerOrder which is the table this trigger is attached to
INSERT INTO tblExpirationDate (AccountID, ExpirationDate)
SELECT AO.AccountID, CO.ServiceStartDate+(31) AS ExpirationDate
FROM tblCustomer C, __new CO, tblPlanType PT, tblAccountOrder AO, tblJobLocation J
WHERE C.CustomerID = CO.CustomerID AND
CO.JobLocationID = J.JobLocationID AND
CO.ServiceStartDate IS NOT NULL AND
CO.PlanID = PT.PlanID AND
CO.OrderID = AO.OrderID AND
(PT.PlanType = 1)
UNION
SELECT AO.AccountID, CO.ServiceStartDate+(365*1) AS ExpirationDate
FROM tblCustomer C, __new CO, tblPlanType PT, tblAccountOrder AO, tblJobLocation J
WHERE C.CustomerID = CO.CustomerID AND
CO.JobLocationID = J.JobLocationID AND
CO.ServiceStartDate IS NOT NULL AND
CO.PlanID = PT.PlanID AND
CO.OrderID = AO.OrderID AND
(PT.PlanType = 12)
UNION
SELECT AO.AccountID, CO.ServiceStartDate+(365*5) AS ExpirationDate
FROM tblCustomer C, __new CO, tblPlanType PT, tblAccountOrder AO, tblJobLocation J
WHERE C.CustomerID = CO.CustomerID AND
CO.JobLocationID = J.JobLocationID AND
CO.ServiceStartDate IS NOT NULL AND
CO.PlanID = PT.PlanID AND
CO.OrderID = AO.OrderID AND
(PT.PlanType = 60);