Creating SQL queries

InfoWorks WS Pro implements its own subset of SQL (Structured Query Language) for selecting and updating network objects using specified criteria.

To create a SQL query:

  1. Open a network. One of the network views must be the current active windowThe current Active Window in any Microsoft Windows application has a differently coloured title bar to all the other windows. In the default colour scheme, the active window title bar is blue, all other windows have a grey title bar..
  2. Choose Selection | SQL select, or click the (SQL select) button from the Operations toolbar. This opens the SQL dialog.
  3. In the SQL dialog, click the SQL tab to open the SQL page.
  4. On the SQL page, select the options to be used when running the query:
  5. Enter the SQL query in the text box at the bottom of the dialog. The Field dropdown list contains only valid field names for the object type selected, and the GIS Field dropdown list contains only valid GIS field names for the GIS layer selected. Choosing fields from either of these lists automatically adds them to the query.

    Tip: Starting a section of text with /* and finishing it with */ will turn that part into a comment, and it will consequently be ignored when the query is executed.

  6. Validate the syntax by clicking the Test button.
  7. To save the query for future use, see Saving SQL queries as stored queries.
  8. Carry out the query by clicking the Apply or Run button. (The dialog is closed after the query has been run if the Run button is used, but will remain open if the Apply button is used.)

SQL and stored queries