• InfoWater Pro

Building database queries for model searches

Set up database queries to use with a modeling project.


Tutorial resources

These downloadable resources will be used to complete this tutorial:


00:03

In info Water Pro A database query is a time saving tool

00:07

that searches one or more fields within one or more database tables.

00:11

For specific information,

00:14

the records that match the query are

00:16

entered into a database table domain or facility

00:21

queries are built using structured query language SQL.

00:25

But even if you do not know the language,

00:27

you can use the query builder to help construct your searches.

00:31

In this exercise, you set up a few DB queries to use with the modeling project

00:37

to begin

00:38

double click the desired project dot APR X file to open Argi

00:42

Pro.

00:44

Once the project starts,

00:45

click the info water pro tab to open the info water pro ribbon

00:50

in the project panel, click initialize

00:55

in the model explorer operation tab,

00:57

right? Click DB query and select new

01:03

enter eight inch comma eight inch pipes as the query ID

01:08

and then click OK to open the DB query dialog box

01:13

in the element type dropdown list, select pipe,

01:18

click the query builder button which has the icon that shows

01:21

an arrow and three colored bars to open the query builder.

01:25

The query builder helps you create your pipe query with the proper SQL

01:28

syntax

01:31

in the pipe. Hi pipe hydraulics, tab, select pipe hi diameter inches

01:37

note the green checkmark appears to indicate the selected field.

01:42

Select the operator equals

01:45

and then enter eight in the empty field.

01:49

Click add

01:51

the query statement to select eight inch pipes is

01:54

entered in the query statement box with the proper SQL

01:57

format.

01:59

Click validate

02:02

the query statement is validated

02:04

if the query statement is not a valid SQL statement

02:07

or if it does not select a single feature,

02:10

an error is returned.

02:12

In this case, your query should be valid.

02:15

Click, OK, to close the query validation pop-up and OK.

02:18

Again to close the query builder.

02:22

Once you have an existing query, like the one you just created,

02:25

you can use it as a starting point to create a more sophisticated query by cloning it

02:31

in the DB query dialog box. Select the eight inch query

02:35

click clone

02:36

and enter eight I N underscore Z 48 inch pipes in zone four as the new ID

02:45

click. OK.

02:48

Make sure that your new query is selected

02:51

in the query statement tab, click the arrow icon to open the query builder.

02:57

Click in the query statement box so that your cursor is to

02:60

the right of the existing statement following all zeros in 8.0,

03:09

double click the and operator

03:11

the end function appears in the query statement box.

03:15

Switch to the pipe tab,

03:18

select pipe zone in the data field,

03:23

select the operator equals

03:26

and then enter four in the empty field.

03:29

Click add

03:31

now review your query statement.

03:34

Your first query selected all eight inch pipes.

03:37

Whereas this new query selects all eight inch pipes in pressure zone four,

03:42

click validate and the group indicates that it is valid.

03:47

Click, OK, to close the query validation pop-up and OK.

03:50

Again to close the query builder,

03:53

close the DB query dialogue box.

03:57

These queries are now available for use with databases, reports and selections.

04:03

You can see your two queries in the model explorer operation tab. Under DB query,

04:08

any number of queries can be stored in this area of

04:11

the operation tab and queries can be shared between projects.

Video transcript

00:03

In info Water Pro A database query is a time saving tool

00:07

that searches one or more fields within one or more database tables.

00:11

For specific information,

00:14

the records that match the query are

00:16

entered into a database table domain or facility

00:21

queries are built using structured query language SQL.

00:25

But even if you do not know the language,

00:27

you can use the query builder to help construct your searches.

00:31

In this exercise, you set up a few DB queries to use with the modeling project

00:37

to begin

00:38

double click the desired project dot APR X file to open Argi

00:42

Pro.

00:44

Once the project starts,

00:45

click the info water pro tab to open the info water pro ribbon

00:50

in the project panel, click initialize

00:55

in the model explorer operation tab,

00:57

right? Click DB query and select new

01:03

enter eight inch comma eight inch pipes as the query ID

01:08

and then click OK to open the DB query dialog box

01:13

in the element type dropdown list, select pipe,

01:18

click the query builder button which has the icon that shows

01:21

an arrow and three colored bars to open the query builder.

01:25

The query builder helps you create your pipe query with the proper SQL

01:28

syntax

01:31

in the pipe. Hi pipe hydraulics, tab, select pipe hi diameter inches

01:37

note the green checkmark appears to indicate the selected field.

01:42

Select the operator equals

01:45

and then enter eight in the empty field.

01:49

Click add

01:51

the query statement to select eight inch pipes is

01:54

entered in the query statement box with the proper SQL

01:57

format.

01:59

Click validate

02:02

the query statement is validated

02:04

if the query statement is not a valid SQL statement

02:07

or if it does not select a single feature,

02:10

an error is returned.

02:12

In this case, your query should be valid.

02:15

Click, OK, to close the query validation pop-up and OK.

02:18

Again to close the query builder.

02:22

Once you have an existing query, like the one you just created,

02:25

you can use it as a starting point to create a more sophisticated query by cloning it

02:31

in the DB query dialog box. Select the eight inch query

02:35

click clone

02:36

and enter eight I N underscore Z 48 inch pipes in zone four as the new ID

02:45

click. OK.

02:48

Make sure that your new query is selected

02:51

in the query statement tab, click the arrow icon to open the query builder.

02:57

Click in the query statement box so that your cursor is to

02:60

the right of the existing statement following all zeros in 8.0,

03:09

double click the and operator

03:11

the end function appears in the query statement box.

03:15

Switch to the pipe tab,

03:18

select pipe zone in the data field,

03:23

select the operator equals

03:26

and then enter four in the empty field.

03:29

Click add

03:31

now review your query statement.

03:34

Your first query selected all eight inch pipes.

03:37

Whereas this new query selects all eight inch pipes in pressure zone four,

03:42

click validate and the group indicates that it is valid.

03:47

Click, OK, to close the query validation pop-up and OK.

03:50

Again to close the query builder,

03:53

close the DB query dialogue box.

03:57

These queries are now available for use with databases, reports and selections.

04:03

You can see your two queries in the model explorer operation tab. Under DB query,

04:08

any number of queries can be stored in this area of

04:11

the operation tab and queries can be shared between projects.

Step-by-step:

In InfoWater Pro, a database query is a time-saving tool that searches one or more fields within one or more database tables for specific information. The records that match the query are entered into a database table, domain, or facility.

Queries are built using Structured Query Language (SQL), but even if you do not know the language, you can use the Query Builder to help construct your searches in the proper SQL syntax. In this exercise, you set up a few DB queries to use with a modeling project.

  1. Open the appropriate .aprx file in ArcGIS Pro.
  2. From the ribbon, InfoWater Pro tab, Project panel, click Initialize.
  3. In the Model Explorer, Operation tab, right-click DB Query and select New.
    The Model Explorer, DB Query tool, with the New option called out in the submenu
  1. In the DB Identification popup, type “8inch, 8 inch pipes” as the DB Query ID.
  2. Click OK.
  3. In the DB Query dialog box, expand the Element Type drop-down and select Pipe.
  4. Click the Query Builder button (arrow icon) to open the Query Builder.
    The DB Query dialog box, with the Query Builder button highlighted for selection
  1. In the Query Builder, PIPEHYD (pipe hydraulics) tab:
    1. In the Data Field pane, select PIPEHYD->DIAMETER(in). Note the green check mark appears to indicate the selected field.
    2. Select the Operator = (equals).
    3. Enter 8 in the empty field.
    4. Click Add.

The Query Builder dialog box, with the PIPEHYD tab active and the query statement being built

The query statement to select 8-inch pipes is entered in the Query Statement box with the proper SQL format.

  1. Click Validate.

The query statement is validated. If the query statement is not a valid SQL statement, or if it does not select a single feature, an error is returned. In this case, your query should be valid.

  1. Click OK to close the Query Validation popup.
  2. Click OK to close the Query Builder.

Once you have an existing query, like the one you just created, you can use it as a starting point to create a more sophisticated query by cloning it.

  1. In the DB Query dialog box, select the 8INCH query.
  2. From the toolbar, click Clone.
    The DB Query dialog box, with the 8INCH query selected and the Clone tool highlighted for selection
  1. In the DB Identification popup, type “8IN_Z4, 8 inch pipes in Zone 4”as the DB Query ID.
  2. Click OK.
  3. In the DB Query dialog box, select the 8IN_Z4 query.
  4. Click the Query Builder button (arrow icon) to open the Query Builder.
  5. In the PIPE tab:
    1. Click in the Query Statement box so that your cursor is to the right of the existing statement (following all zeros in 8.000000).
    2. Double-click the .AND. operator. The .AND. function appears in the Query Statement box.
    3. In the Data Field pane, select PIPE->ZONE.
    4. Select the Operator = (equals).
    5. Enter 4 in the empty field.
    6. Click Add.
    7. Review your Query Statement.

The first query selected all 8-inch pipes, whereas this new query selects all 8-inch pipes in pressure zone 4.

The Query Builder, with the PIPE tab active and the query statement being built

  1. Click Validate.

The popup should indicate that the query is valid.

  1. Click OK to close the Query Validation popup.
  2. Click OK to close the Query Builder.
  3. Close the DB Query dialog box.

The queries are now available for use with databases, reports, and selections. They are listed in the Model Explorer, Operation tab, under DB Query:

The Model Explorer, Operation tab, with the DB Query node expanded and the two newly created queries highlighted

Any number of queries can be stored in this area of the Operation tab, and queries can be shared between projects.

Was this information helpful?