Databases Reference
In-Depth Information
Example 4-23 Sample session updating a product in the inventory program
-------------------------------------------------
SIMPLE INVENTORY MANAGEMENT SYSTEM
1. Add New Product
2. Update Product Info (Quantity or Location)
3. Query Product
4. Exit
Enter option: 2
-------------------------------------------------
Update A Product
1. Update quantity
2. Update location
Enter option: 1
Enter product ID to update: 101-101-10
Enter new quantity : 20
Product successfully updated.
-------------------------------------------------
4.3.16 Complete C inventory program
After adding the data retrieve and manipulation code into the inventory program
template shown in Example 4-4 on page 154, we have a complete C inventory
program as shown in Example 4-24.
Example 4-24 inventory.sqc
/******************************************************
** Source File Name: inventory.sqc
**
** This simple C program will manage the inventory of
** products for a company
**
*******************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
EXEC SQL BEGIN DECLARE SECTION;
Search WWH ::




Custom Search