The uni_csr_disp.c sample program demonstrates using a read-only cursor. It is a modification of the csr_disp.c sample program and requires the unipubs2 database. It performs the following:
It opens a cursor with a canned 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.
Following is the canned query:
select au_fname, au_lname, postalcode from authors
For instructions on installing the unipubs2 database, read the README file available in the $SYBASE/$SYBASE_OCS/sample/ctlibrary directory.