ODBC display values

Some examples of how to use and work with ODBC display values are shown here.

Display values in Choice and Reference columns

When querying a column of type Choice or Reference, an additional column with the prefix dv_ is available that contains the display value. For example, you can select dv_caller_id to return the sys_user.name display value of the reference field from an incident record without making another request to the sys_user table.

Figure 1. Return the display value

Display values in filter conditions

Display values can also be used in a filter condition. The ODBC driver optimizes the query condition and processes the filter on the server, for example, querying on the display value of sys_user for the caller_id field of an incident by using the dv_caller_id field name.

Figure 2. Display values in filter conditions

Display values in aggregate queries

Aggregate queries can also take advantage of display values if you specify them in the group by or where clause, for example, grouping on the caller_id field of an incident, as well as specifying a filter for it. The query is optimized by passing through to the server.

Figure 3. Display values in aggregate queries