# 09-db-update — Database Update Simulation ## 电信业务场景 客户信息DB更新。使用索引文件模拟关系数据库,实现客户信息的INSERT、UPDATE、DELETE操作。 ## Purpose Simulates DB update operations (INSERT, UPDATE, DELETE) using GnuCOBOL INDEXED files as a stand-in for EXEC SQL. ## Test Coverage 1. **INSERT 3 records** — WRITE to indexed file with STATUS check 2. **Duplicate INSERT** — Attempt key duplicate, expect STATUS 22 3. **UPDATE** — READ then REWRITE to modify an existing record 4. **DELETE** — READ then DELETE to remove a record 5. **Verify** — START + READ NEXT to read back remaining records 6. **Report** — Summary output to report.txt ## Key Techniques - INDEXED file with DYNAMIC access - FILE STATUS checking (00=OK, 22=dup, 23=not found, 10=EOF) - WRITE / REWRITE / DELETE with INVALID KEY - START + READ NEXT for sequential traversal