Progress
Language Tutorial
for Windows
Query and Selection Programming Example
This example demonstrates selecting records with a defined query:
- Open
lt-09-01.p
and run it.- Choose the first Query button. The following browse widget appears with the results of the query. In the status area, notice the message that shows the selection syntax used in the particular OPEN QUERY statement:
![]()
- Choose the second and third Query buttons.
- Choose the fourth Query button. This example uses the USING option, so you have to provide a value to search for. A dialog box appears to prompt you for the Item-Num.
- Type an integer from 1 to 55, then choose OK. The browse widget displays the results.
- Choose Exit, then press SPACEBAR to return to the Procedure Editor.
Here is the code that created the display:
NOTE: The THREE-D option is relevant only on a Windows client; it is ignored by a character client.These notes help explain the code, describing how to query and use the browse widgets:
- Even though the procedure makes several queries, each query uses the same table (Item) and only one query is active at a time. Therefore, you need only one defined query.
- Similarly, although the procedure uses the browse widget to display several queries, only one is displayed at a time.
- The first query uses a WHERE expression to display all the inventory items with item numbers greater than 45.
- The second query uses a WHERE BEGINS query to list all the items with names that begin with "ski".
- The third query uses a WHERE MATCHES query to see if any of the item names end with "ball".
- The fourth query uses the USING option to allow the user to define the query. The USING item accepts a screen value for a table field, then finds the records that have that value.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |