| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- -- ============================================================
- -- Prepare Batch 操作测试
- -- ============================================================
- -- 1. 通过 loop 模拟 prepare batch 插入
- insert into /test/aaa/test_prepare (p_name, p_int) values (?, ?)
- /**
- scope(mql)
- loop(5)
- params("prep_batch_{%d,mqli}", {%d,mqli})
- **/
- ;
- -- 2. 验证 prep batch 插入结果
- select p_name, p_int from /test/aaa/test_prepare where p_name=^'prep_batch'
- /**
- output()
- **/
- ;
- -- 3. 再次使用 loop 做批量 update
- update /test/aaa/test_prepare set p_int=? where p_name=?
- /**
- scope(mql)
- loop(5)
- params(999, "prep_batch_{%d,mqli}")
- **/
- ;
- -- 4. 验证批量更新
- select p_name, p_int from /test/aaa/test_prepare where p_name=^'prep_batch'
- /**
- output()
- **/
- ;
- -- 5. 批量删除(删除前 3 条)
- delete from /test/aaa/test_prepare where p_name=?
- /**
- scope(mql)
- loop(3)
- params("prep_batch_{%d,mqli}")
- **/
- ;
- -- 6. 验证批量删除
- select p_name from /test/aaa/test_prepare where p_name=^'prep_batch'
- /**
- output()
- **/
- ;
|