The csr_disp_implicit.c sample program demonstrates using an implicit read-only cursor:
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.
The program flow is the same as the csr_disp.c sample program, with the only difference being the usage of the CS_IMPLICIT_CURSOR option instead of CS_READ_ONLY in the first ct_cursor call. Although, the generated output is the same as the csr_disp.c example, the use of CS_IMPLICIT_CURSOR potentially reduces network traffic at the network level.
When using this example, it is important to set the CS_CURSOR_ROWS option to a value greater than 1.
This is the canned 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 12.5.1
or later and the pubs2 database.