jdbc 与 each controller 对多条查询结果的处理

这里 userid 是从前面 sql语句中查到的其中一个字段的结果

这里设置变量的前缀,即使用userid进行循环,输出变量名称为 current_userid 

假设另外一个变量的名字为mobile, 则在for each循环器中,我们可以使用mobile_1,mobile_2.....来获得mobile这个值的内容

 

这里我们需要使用一个 __V功能,它可以将两个变量进行组合

he V (variable) function returns the result of evaluating a variable name expression. This can be used to evaluate nested variable references (which are not currently supported).

For example, if one has variables A1,A2 and N=1:

  • ${A1} - works OK
  • ${A${N}} - does not work (nested variable reference)
  • ${__V(A${N})} - works OK. A${N} becomes A1, and the __V function returns the value of A1
  

这个功能很有用, ${__V(mobile_${__counter(,)})}  这里就会返回 mobile_1 , mobile_2等的值.

posted on   yingchen  阅读(281)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示