Wide tables cursor sample program

The wide_curupd.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 named “state” in the publishers table.

Inputs value for the input parameter (“state” column from the “publishers” table) for the UPDATE. Create a publishers3 table as shown below before running the sample program:

use pubs2
go
drop table publishers3
go
create table publishers3 (pub_id char(4) not null, 
pub_name varchar(400) null, city varchar(20) null,
state char(2) null)
go
select * into publishers3 from publishers
go
create unique index pubind on publishers3(pub_id)
go