The csr_disp.c demonstrates using a read-only cursor:
It opens a cursor with a query.
It processes the results using the standard ct_results while loop.
It binds the column values to program variables.
It fetches and displays the rows in the standard ct_fetch while loop.
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 sample requires the pubs2 database.