EXIT-SELECT

Syntax

EXIT-SELECT

Description

Exits a SELECT paragraph immediately.

EXIT-SELECT causes SQR to jump to the command immediately following the END-SELECT command.

Use EXIT-SELECT when you need to end a query before all rows have been retrieved.

Example

The following example illustrates the EXIT-SELECT command:

begin-select
cust_num, co_name, contact, city, state, zip, employees
  add &employees to #tot_emps
  if #tot_emps >= 5000
    exit-select         ! Have reached required total emps.
  end-if
  do print_company
from customers order by employees desc
end-select

See BEGIN-SELECT