首页 > 解决方案 > 具有多个参数的 kdb 更新语句中的行操作

问题描述

myFunc:{[x]
   // ...
}

我知道我可以通过这种方式使用更新语句对我的表执行行操作:

update newVal: myFunc each someField from someTable;

现在,如果我的函数需要 2 个参数:

myFunc2: {[x;y]
   // x and y are different types
}

我现在如何在每行操作中传递两个参数?我试过这些:

update newVal: myFunc2 each someField, otherField from someTable;
update newVal: myFunc2 . (someField;otherField) from someTable;

似乎没有用,将多个参数传递给更新 stmt 中的函数的正确方法是什么?

标签: kdb

解决方案


您应该使用each-both副词',如下例所示

update newVal: myFunc2'[someField;otherField] from someTable

推荐阅读