Files
NB-076 94400d50d4 feat: add benchmark-programs — 58 telecom COBOL test programs
作为子目录纳入系统,与核心测试管道协同

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-25 09:53:21 +08:00

23 lines
906 B
Markdown

# 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