Querying Progress Audit data

KrisM

Member
Code:
for each _aud-audit-data no-lock where
         _aud-audit-data._event-context begins ("PUB.Debtor" + chr(6)):
...

This simple query is not working as expected, because it also returns results for PUB.DebtorInvoice.
I could rewrite it like this, but this is an unindexed query, so it will take much longer to execute.

Code:
for each _aud-audit-data no-lock where
         entry(1,_aud-audit-data._event-context,chr(6)) = "PUB.Debtor":
...

A better indexed query would look like this:
Code:
for each _aud-audit-data no-lock where
         _aud-audit-data._event-context begins "PUB.Debtor" and
         entry(1,_aud-audit-data._event-context,chr(6)) = "PUB.Debtor":   
...

Does anybody have an explanation why the begins operator is not working as i expect ?
 
Top