First page Back Continue Last page Graphics

Using View Criteria (Structured WHERE Clauses)


Notes:

Using Structured WHERE Clauses (View Criteria)

Instead of changing WHERE clauses using string manipulation, you may find it more efficient to use view criteria to assemble complex WHERE clauses. View criteria are named expressions that you can use to assemble a WHERE clause.

A view criteria row specifies query-by-example requirements for one or more view object attributes. For example, suppose the view object definition CustOrdVO includes the following attributes: LastName, OrderTotal, and DiscountId. Then a view criteria row for an instance of CustOrdView could specify requirements for each of these attributes, such as: LastName STARTSWITH ā€œSā€, OrderTotal > 500, and DiscountId <> NULL.

Another view criteria row for this instance could specify different requirements for a different set of attributes, such as: OrderTotal > 1000, and CreditLimit > 5000.

For a view criteria row to be satisfied, all of its attribute requirements must be met.

View criteria are made up of collections of view criteria rows. For the view criteria to be met, at least one of the rows must be satisfied. For example, if vc1 has the requirements: OrderTotal > 500, CreditLimit > 2500, and DiscountId <> NULL, and vc2 has the requirements: OrderTotal > 1000 and CreditLimit > 5000, then the complete view criteria are equivalent to the following WHERE clause condition: