Queries with joins

You can use joins to display information from two or more tables. These joins are handled automatically.

To use the join functionality, specify the tables (targets) and the columns from those tables that you want in the core.executeQuery select parameter. The underlying query system computes the necessary join criteria transparently and displays the correct results.

Note: An error appears if there is no join information registered for the tables when the query runs.

You can use the core.listTables command to determine which tables are related and are capable of participating in joins. The relatedTables table property contains this join information.

Example query with a join

This example executes a simple join between the OrionTaskLogTask and OrionTaskLogMessage tables.

URL: https://servername:port/remote/core.executeQuery?target=OrionTaskLogTaskMessage&select=(select OrionTaskLogTask.Name OrionTaskLogTaskMessage.Message )&joinTables=OrionTaskLogTask 

Python: mc.core.executeQuery(target="OrionTaskLogTaskMessage", select="(select OrionTaskLogTask.Name OrionTaskLogTaskMessage.Message )", joinTables="OrionTaskLogTask")

OK:
Name: New Task
Message: Purge audit log

Name: New Task 
Message: Purge audit log (Purge log records older than: 1 days)