Terry Terry - 9 months ago 58
SQL Question

update in partitioned table

i am trying to update a null value to 0f so it can be used for aggregation.

The following is my code:

update x:0f from data where date=2016.07.01,null x;

but it didn't work on a partitioned table, how am i able to update on a partitioned table?


Answer Source

The "par" error occurs when you try to update a partitioned table, which you can't do like that. Instead you have to generate the updated column and write back to disk.

If you're doing this to all date slices, your best bet might be to use the "fncol" function in the dbmaint utilities (http://code.kx.com/wiki/Contrib/dbmaintdotq) to apply a function to the column throughout history. For example