解决了

遍历数据库结果表

  • 2023年7月21日
  • 2回答
  • 5视图

Userlevel 3
徽章 + 2
  • 社区负责人
  • 16日回复

在数据库标准模块的帮助我做一个选择在一个数据库表中。
我想遍历所有返回的行选择和做的东西。

我发现这是唯一:https://support-hub.tricentis.com/open?id=kb188金宝搏app苹果下载软件_article_view&sys_kb_id=e059c7fddb24df4cb3e1a103ca9619fa

从性能角度来看这个解决方案似乎并不好。SQL语句执行一遍又一遍地为每个迭代。密集的SQL语句的时候你不应该这样做。其实你不应该这样做,即使它不是:)

任何想法如何执行SQL语句一次遍历所有行吗?

我在文档,您可以看到结果表内容导出到csv文件。但是我没有找到如何然后逐行读取csv文件,做的东西…

图标

最佳答案社区管理员2023年7月21日11:42

Another possible solution would be to first download the result in a csv and then load it into caching database, then verify the data as per your needs would be faster. Of course the SET is a smarter solution.\u00a0<\/p>","className":"post__content__best_answer"}">
查看原始

2回答

Userlevel 3
徽章 + 2

一些用户以下解决方案:

我创建了自己的“特殊执行任务”与c#:

590年ed23687a0d5508bdc326e3fbb3512.iix

下面的调用此模块将创建缓冲区的结果值的形式:

sql_Count:结果行数,所以我可以遍历所有

sql_Column1_(行号)

sql_Column2_(行号)

位置(行号)是一个数字从1到最大数量的结果行吗

682年ed63687a0d5508bdc326e3fbb359e.iix

解决我所有的问题:SQL语句被执行一次。我自动缓冲区中的所有值,这样我可以使用它们后……

Userlevel 3
徽章 + 2

另一个可能的解决方案是首先下载csv的结果,然后加载到缓存数据库,然后验证数据按你的需求将会更快。当然是一个更聪明的解决方案。

回复


Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu
map