Passing a table name to a function

Hi,

This should be a straightforward question for most q/kdb+ regulars.

I need to update a table’s contents by passing a table name to a
function that does the updation.
Assume that the function is called updation

updation:{[table;symb;times;newsize;exchange] table:update
size:newsize from table where sym=symb,time=times}

and a call to the fucntion would be like
updation[trade;GOOG;09:40:00.000;1234;NASDAQ]

Please help me out with this issue…

Regards,
Nav

May be?

q) updation:{[table;symb;times;newsize;exchange] table set update
size:newsize from table where sym=symb,time=times}

and call:

q) updation[`trade;`GOOG;09:40:00.000;1234;`NASDAQ]

or

q)?updation[`$“trade”;`GOOG;09:40:00.000;1234;`NASDAQ]

… or

q) updation:{[table;symb;times;newsize;exchange] (`$table) set update
??size:newsize from table where sym=symb,time=times}

> updation:{[table;symb;times;newsize;exchange] table:update size:newsize from table where sym=symb,time=times}
>
> and a call to the fucntion would be like updation[trade;GOOG;09:40:00.000;1234;NASDAQ]

use pass-by-name

updation:{[table;symb;times;newsize;exchange] update size:newsize from
table where sym=symb,time=times}

updation[`trade;`GOOG;09:40:00.000;1234;`NASDAQ]