Terry Terry - 1 month ago 8
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?

Thanks,
Terry

Answer

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

fncol[`:/path/to/db;`data;`x;0f^]