csr_disp_scrollcurs2.c uses a scrollable cursor to retrieve data from the authors table in the pubs2 database:
It sends a query to the server to open a cursor.
It processes the results using the standard ct_results while loop.
It binds the column values to program variables.
It fetches the rows using ct_scroll_fetch and displays them.
This example uses a scrollable cursor with arrays as program variables and array binding. A single ct_scroll_fetch call displays results in an array.
This is the query:
select au_fname, au_lname, postalcode
from authors
For more information about this sample program, see the leading comments in the example source file.
This example requires Adaptive Server version 15.0 or
later, with scrollable cursor support and the pubs2 database.