The csr_disp_scrollcurs.c sample program uses a scrollable cursor to retrieve data from the authors table in the pubs2 database:
Sends a query to the server to open a cursor.
Processes the results using the standard ct_results while loop.
Binds the column values to program variables.
Fetches and displays the rows in the standard ct_scroll_fetch while loop.
This example requires Adaptive Server version 15.0 or
later, with scrollable cursor support, and the pubs2 database.
This example uses a single prefetch buffer and regular program variables. This is the query:
select au_fname, au_lname, postalcode
from authors