Debugging Synchronized Systems
Page 3 of 4

Example Queries

To list in order all failed transactions from publication MY_PUB, issue the following query:

SELECT e.errorTime, printFailedTransaction(e.errorID)
FROM SYS.SYSERRORS e, SYS.SYSPUBS p
WHERE p.publicationName='MY_PUB'
    AND p.publicationID=e.publicationID
ORDER BY e.errorTime

To restrict the previous query to a particular one-hour window, issue a query like the following:

SELECT e.errorTime, printFailedTransaction(e.errorID)
FROM SYS.SYSERRORS e, SYS.SYSPUBS p
WHERE p.publicationName='MY_PUB'
    AND p.publicationID=e.publicationID
    AND e.errorTime BETWEEN TIMESTAMP'1999-05-01 10:00:00'
        AND TIMESTAMP'1999-05-01 11:00:00'
ORDER BY e.errorTime

The following query generates output that includes the time of the transaction failure, the associated error message, and the TransactionListVTI output from SYSERRORS. The output shown here is a fragment.

SELECT e.errorTime, e.errorinfo.getErrorMessage(), printFailedTransaction(e.errorID) FROM SYS.SYSERRORS e;


ERRORTIME                 |SQLCol1                                             |SQLCol2
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
1999-09-29 11:28:48.158   |The statement was aborted because it would have     |TransactionLis&
                           caused a duplicate key value in a unique
                           or primary key constraint