In the SQL, I try to join 'user' entity with external DB (oracle) and prompt below error
"Invalid Query query cannot be simultaneously using Entities (Platform Database) and the following Foreign Entities"
Hello Jessica.
An Aggregate or Advanced SQL, is nothing more than a SQL Query in disguise.
You can't do it without linking the servers.
Please look at this old thread. It is still valid.
https://www.outsystems.com/forums/discussion/10253/query-cannot-be-simultaneously-using-entities-and-the-following-foreign-entities/
Hi Jessica,
Please bear in mind that cross server joins are very inefficient and they should be avoided at all costs.
They are not considered a Performance Best Practice.
Regards,
Nordin
Thank all,
As my outsystem platform is on cloud, the service center doesn't have the 'Database Catalog' to configure. Please advise.
You need to set a VPN to connect cloud to internal servers.
Yes, it is not advisable (Best Practices has MANY warnings against it).
We have VPN connect between outsystem cloud and internal servers.
Then, what steps I should follow to join data from user entity (internal DB) and oracle
Cross server joins are very inefficient because the table in the linked server is completely loaded to the local DB server and then the join is performed. Cross server joins may be acceptable if the tables are small and unavoidable but as a rule cross server joins should be avoided as much as possible.
In: https://success.outsystems.com/Documentation/Best_Practices/Performance/Performance_Top_10_Rules
It will depend on the type of join.
If you only need to filter, I would save the ids into a string and apply it as inline parameters.
If you need columns from it, I think performance-wise the best approach is to:
The most probable scenario is:
Thank Nuno.
May I clarify more?
2. Do a join. You mean to do the program logic myself
Actually, I change my mindset to SQL and forgot OS. You have to do it differently.
This is for a DBA:
And this is for OS developer:
It sounds confusing and you may need more time to understand becasue it really isn't that common to use.
The normal would be to fetch a single record from Id. If you need the full table, you should import it to OS.