The following procedure uses a cursor on a SELECT statement. It illustrates several features of the stored procedure language, and is based on the same query used in the ListCustomerValue procedure described in “Returning result sets from procedures”.
See ”Using cursors on SELECT statements in procedures” in SQL Anywhere Server - SQL Usage.