【发布时间】:2013-11-21 14:09:20
【问题描述】:
我有一个使用唯一标识符对数千行(更准确地说是 28,000 行)执行的查询。 这是(简化的)查询:
update "table1" set event_type = 'NEW' where id=
还有一个文件ids.txt,其中包含要执行更新的行的ID:
10003
10009
....
....
79345
79356
生成的文件应该是这样的:
update "table1" set event_type = 'NEW' where id=10003;
update "table1" set event_type = 'NEW' where id=10009;
...
update "table1" set event_type = 'NEW' where id=79356;
其他除了获取ids.txt文件并使用vim使用全局字符串替换来形成所有28000个查询之外,有没有简单的方法来做到这一点?
【问题讨论】: