The programming syntax you have learned so far uses blocks of ABL code to define and iterate through a set of records. ABL defines an alternative to this form of data access called a query. You saw queries in action already, in the section where you looked at the syntax the AppBuilder generates to define a default result set for a window and to display its records in a browse. This section discusses why these different forms exist and how you can use queries in ways that are distinct from how you would use a result set in a FOR EACH block.

Why you use queries in your application

The first question to answer about queries is why ABL has them at all. For many years, ABL did not support queries, and developers wrote very powerful and complete applications without them. So, before you go into the details of how to define and use queries, you learn the differences between queries and the block-oriented data access language you used so far.