SQL call function with 2 args

https://learninghub.kx.com/forums/topic/sql-call-function-with-2-args

I have a function which takes 2 arguments. Ill write some pseudo code for an idea

f:{[x;y] $[x~1;y;0]}

Then i have a table:

t:(a:123;b:456)

Now i want to call that function and pass a and b to it from an update statement

update c:f[a;b] from t;

update c:f[a;b] from t;

This however doesnt work because its passing the whole column instead of just an item. Now i know if it was just 1 arg i could just do an “each” but I’m not sure how to do that with 2 args.

You’re right in using an each iterator, by using:

update c:f'[a;b] from t 
a b c 
----- 
1 4 4 
2 5 0 
3 6 0