Share
 
 

SQL and connected objects

SQL queries can be carried out using the data fields of related or linked objects as well as the object type selected on the SQL dialog.

To see the full list of fields which can be queried for a specific object type, simply scroll through the list in the Field box of the SQL dialog.

The options us_links.<field> and ds_links.<field> are available for all link and node objects. In addition the options us_nodes.<field> and ds_nodes.<field> are available for all link objects.

There are many other such linked objects depending on what has been selected in the Object Type field.

Note: Be careful not to confuse linked objects with array data as the syntax is the same - array.field and linked_object.field.

Some examples of SQL queries using connected object data fields are given below. The examples are taken from the Autodesk product InfoWorks CS, but the basic principles are relevant to whichever Autodesk product is being used.

Example 1

The very simple example below shows a query to select upstream node for a pipe that has demand.

Example 2

The example below shows a query to select nodes where the upstream link length is greater than 50.

A node will be selected if the query is true for any of its upstream links.

Example 3

The example below shows a query to set user text 1 where upstream links are longer than 50 m.

Was this information helpful?