Search code examples
filenet-p8filenet-content-enginefilenet

Use "NOT IN" in FileNet queries


If I want to restrict the value of a metadata to a subset, I would do something on the line of standard SQL synthax ("IN" operator):

SELECT This, ID from MyClass WHERE MyMetadata IN ('AAA', 'BBB')

But how can I do the opposite, so obtaining all the results for which the metadata value is not in the subset?

By using the standard "NOT IN" operator:

SELECT This, ID from MyClass WHERE MyMetadata NOT IN ('AAA', 'BBB')

I obtain a synthax error.


Solution

  • FileNet SQL synthax is a bit different, and the NOT operator should be placed before. Like this:

    SELECT This, ID from MyClass WHERE NOT (MyMetadata IN ('AAA', 'BBB'))