In this case, create three classes as stated above. Compile them. Than change the superclass for tempPersistentClass to %Persistent and delete it from the other 2. This way you will still have the separate storage for the Customers and Suppliers, but you will also get the separate storage for temp class.

Or I think you can set up the storage for classes manually. but this will be harder.

If I understand your questions correctly, you want to store Customers and Suppliers separately. If you don't need to store tempPersistentClass as well, you can just do the following:

Class tempPersistentClass
{...}

Class Customers Extends (%Persistent, tempPersistentClass)
{...}

Class Suppliers Extends (%Persistent, tempPersistentClass)
{...}

In this case Customers and Suppliers will have their own globals (^CustomersD and ^SuppliersD) each and not use the storage from tempPersistentClass.

Considering that this query works with files of OS, and not data in the database, I'd hazard a guess that it's a Query based on ObjectScript code. Which basically means that there's no SQL statement to get. 

PS. Here's my article about a Query based on ObjectScript code.

Big congrats to everyone who earned the Implementer of Ideas badge! 🎉

I just want to say how awesome it is to see ideas from the Ideas Portal actually make it into reality. It’s one thing to suggest improvements, it’s another to step up and implement them.

Well done 👏

Iryna Mykhailova · Dec 16, 2025 go to post

It's such an honor to be mentioned in these awards! Congrats to everyone! And Happy Anniversary!

Iryna Mykhailova · Dec 13, 2025 go to post

I joined in February 2016 - I still remember @Evgeny Shvarov sent me a text and asked if I wanted to join the new "official" InterSystems community. And it went on since then. With some pauses, of course 😉Yet, it was always a gratifying experience to be part of the Community and I've learnt a lot!