Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3303 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all

I'm trying to utilise the NOT EXISTS command:

I need to find records in the Cases table that do not have matching records in the Originals table.

So far I have:

SELECT a.Case_ID
FROM Cases a
WHERE a.Closed IS NULL 
AND
NOT EXISTS
    (SELECT * 
     FROM Originals b
     WHERE b.Case_IDF = a.Case_ID)

            
It just freezes when I try this though. Could it be that because there are a lot of records in each table? I will be using additional criteria - not sure if this would improve performance if this is the case.


Any help appreciated.

Thanks

Posted

Most likely it is because "NOT EXISTS" is not supported in FM's SQL syntax.  Check the list of supported functions and keywords.

Posted

It looks, if I am reading this correctly, that you may just have a syntax problem. Each of the examples I've seen, EXISTS is only used directly after a where clause.

Posted

Have got a script trigger to set a flag field in the parent table if no records existing in the child table, then just use a simpler SQL command. It took far too long to do it all in SQL.


Cheers guys

This topic is 3303 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.