The dispcat_pic program

The dispcat_pic program uses the ifx_loc_t locator structure to retrieve two simple-large-object columns. The program retrieves the cat_descr TEXT simple-large-object column and the cat_picture BYTE column from the catalog table of the stores7 demonstration database.

The dispcat_pic program allows you to select a database from the command line in case you created the stores7 database under a different name. If no database name is given, dispcat_pic opens the stores7 database. For example, the following command runs the dispcat_pic executable and specifies the mystores database:
dispcat_pic mystores

The program prompts the user for a catalog_num value and performs a SELECT statement to read the description column from the stock table and the catalog_num, cat_descr, and cat_picture columns from the catalog table. If the database server finds the catalog number and the cat_picture column is not null, it writes the cat_picture column to a .gif file.

If the SELECT statement succeeds, the program displays the catalog_num, cat_descr, and description columns. Since these columns store text, they can be displayed on any platform. The program also allows the user to enter another catalog_num value or terminate the program.