20
Views
2
Comments
Solved
Advance Query - How to select join entity in different database?
Question
Application Type
Reactive

Hi there,

On a premise server whenever creating a module, we need to choose a database catalog (database name). Now i am wondering as we have entities in different database name (same server). Is it possible to select to both database?

like 

select *

from db1.entity

join db2.entity2


regards and thanks

2025-01-09 14-56-57
IQ78
Solution

I just found the answer:

1. use as usual using {}, like select * from {entity1}

2. It confused as if i use SQL sandbox - it should be either using:

USE [db-name]

select *..

--- or

using syntax copied from Executed SQL drown from we join using aggregate

in this case no USE is needed

Warning:

DO NOT use this copied syntax in the Advance Query because there will error:

like prefix... blabla is reserved word...


Best practice:

# create aggregate join

# copy the ''executed sql" and push in the SQL Sandbox forge

# in  the advance query - replace the from table... use {entity} instead of the fully name

# try it

regards


2025-01-09 14-56-57
IQ78

see also

https://www.outsystems.com/forums/discussion/36631/human-readable-change-history-osusr-is-reserved-prefix/

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.