The csr_disp.c sample program demonstrates how to use 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 sample requires the pubs2 database.
This is the query:
select au_fname, au_lname, postalcode from authors