Using a Where Clause to Search for Rows

You can enter SQL statements in the Selection Criteria window to restrict the contents of a list window to those that match certain criteria. You must understand basic SQL and the structure of the table to use the Selection Criteria window. (For more information about SQL statements, see your Sybase or Microsoft documentation. For more information on the table structure, see the Table Structures Guide.)

To use a where clause to search for rows

1 Open the view to list the rows. (For instructions on displaying the list window, see Opening a View in the Table Editor .)
2 Choose File, Where clause, or press SHIFT+F2 to open the Selection Criteria window:

3 Enter the column_name, sign, and value you want to limit the list by.

Here are some examples:

To search for this

Enter this

The loan period for all locations

circ_privilege = 0

The loan period and renewal loan period for all locations

circ_privilege = 0 or circ_privilege = 1

The loan period and renewal loan period for a particular location

(circ_privilege = 0 or circ_privilege = 1) and location = “location_name”

All borrowers who belong to a specific location and are of a particular BTYPE

location = “location_name” and btype = “btype_code”

4 Click OK.

Horizon returns to the list and displays those rows that match the “where” clause parameters.

The Table Editor displays messages that report SQL syntax errors. For those who understand SQL and are willing to examine the database to discover how the underlying tables function, this option gives maximum flexibility in restricting the contents of a list. If you misuse the Where Clause command, you may get a long result list, an error message, or nothing at all. In the worst case, you would get a list that is too long and the program would crash.

 


© 1998-2017 Sirsi Corporation