28.5 Case Study: Accessing an Invoice Database
(cont.)
addinv.cpp
- Prompt for cust# and payment
- Assign unique invoice #:
- Find max of existing invoice #s:
SELECT MAX(Invoice_Number) FROM Invoice
- Add 1
- Insert new row into DB:
string command = "INSERT INTO Item VALUES ('" + invnum +
"', '" + prodcode + "', "
+ int_to_string(quantity) + ")";
prev
|top
|next