0

When trying to delete a conditional expression, you are given the following error message:

BMXAA1066E
Condition <CONDITIONNUM> cannot be deleted since it is being referenced in one or more places.

According to the reference count, this is true - but you don't believe the count to be correct.

ESP
  • 979
  • 2
  • 9
  • 21

2 Answers2

2

You may have auditing turned on for one of the tables that references the condition (e.g. SECURITYRESTRICT) and this is being added to the count. Use the following query to generate a set of statements to locate any references:

select 
  'select * from '||objectname||' where '||attributename||' = ''<CONDITIONNUM>'';'
from maxattribute 
where sameasobject='CONDITION'
and sameasattribute='CONDITIONNUM'
and persistent=1;

For me, it was A_SECURITYRESTRICT adding to the count every time I toggled the re-evaluate switch.

ESP
  • 979
  • 2
  • 9
  • 21
1

To ignore references from specific objects, such as from audit tables, you need to list the objects to ignore in CSV format in the value of the mxe.condition.excludeCheckReference property, as detailed in this technote.

I found that the reference count remained positive, that it continued to count the references from the "excluded" checks, but I was allowed to save, anyway.

Preacher
  • 2,127
  • 1
  • 11
  • 25
  • 1
    Good catch Preacher! It's a shame they didn't just add an option to exclude audit tables entirely but there's only a handful of tables, so it shouldn't be too bad – ESP Sep 15 '16 at 14:36