update partitioned table – par error - Kdb+ / qStudio

Home Forums Kdb+ / qStudio update partitioned table – par error

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #110952

    Steve
    Guest

    I was trying to update a partitioned table in kdb and I got a ‘par error.

    How can I add a computed column to my results?

    e.g. If I wanted to add 10 to the price column from my trade table?

    q)update price+ 10 from trade

    ‘par

    #110953

    Only select queries work against partitioned tables. This is because those selects are specially optimised for using that virtual partitioned column. First select your data then perform the update. e.g. rather than:
    update mprice:price+10 from trade where date=2017.17.01,sym=`A
    do
    update mprice:price+10 from (select from trade where date=2017.17.01,sym=`A)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.