Wide table dynamic data sample program

The wide_dynamic.c sample program uses a cursor to retrieve data from the publishers table in the pubs2 database. It retrieves data row by row and prompts the user to input new values for the column called “state” in the publishers table.

This program uses Dynamic SQL to retrieve values from the titles table in the tempdb database. The select statement, which contains placeholders with identifiers, is sent to the server to be partially compiled and stored. Therefore, every time you call the select, you only pass new values for the key value which determines the row to be retrieved. The behavior is similar to passing input parameters to stored procedures. The program also uses cursors to retrieve rows one by one, which can be manipulated as required.