Invalid Aggregate - Aggregate cannot join data from multiple databases

Invalid Aggregate - Aggregate cannot join data from multiple databases

Hi All,

I have an espace that is working ok at V7 (see top image)
I have updated to V9 and I get the following error:

"Invalid Aggregate
The 'Name' Aggregate cannot join data from multiple databases. Change it to only use entities from a single database." (see btm image)

I understand what the message is saying but I don't understand why. The espace references a foreign entity from a legacy system that is still live and therefore cannot be changed.

Is this a bug... do you have to reference foreign entities in a different way in the newer platform...? basically the old simple query worked fine... the new aggregates function fails...
please help..!!

Thanks Gary
Hi Gary,

That restriction has always been there: One query cannot join tables from different databases.
Can you show us how one of those queries that are giving the errors looked like before the upgrade and how they are now (showing the "sources" of the aggregate in the screenshot)?

João Rosado
Hi João,

I'm surprised to hear that the restriction has always been there.! This app has been running for years using a simple query to pull data from the legacy DB..!
Attached is the screengrab...


How is the external entities imported?
Are they using a Database Connection or they are imported from the platform database with a linked server?
In particular, is on the advanced properties of your external entities is there anything filled on the "Logical Database" property?

João Rosado
I've attached a word doc with various screengrabs of the working V7 app. Hopefully it shows the setup?
Hi Gary,

Thanks for the reply.
Yes setup that should actually work. It's all from the same platform database (without using any separate database connections).

I would recommend you to contact the OutSystems Support if you didn't already and see if they can help you understand why it is giving that error.

I tried to replicate it locally and was unable to. It only gives me errors when I use entities in my aggregate that have the "Logical Database" filled.

João Rosado
Thanks for the sanity check João - I'll log with support now and post back here when I have an answer..!