Search code examples
bulkupsertkdb+

How to bulk upsert in kdb+


It is possible to bulk upsert into a partitioned table. I have tried several of syntax combination and none works.

Ex.

`:2015.12/calls/ upsert (1; 4389; 2015.12.01T07:56:50) // single upsert works
`:2015.12/calls/ upsert (1 2; 4389 4397; 2015.12.01T07:56:50 2015.12.01T07:56:58) // do not work
`:2015.12/calls/ upsert ((1; 4389; 2015.12.01T07:56:50);(2; 4397; 2015.12.01T07:56:58)) // do not work.

Thanks


Solution

  • You need to upsert a table i.e.:

    / substitute `COL1`COL2`COL3 with actual column names
    `:2015.12/calls/ upsert flip `COL1`COL2`COL3!(1 2; 4389 4397; 2015.12.01T07:56:50 2015.12.01T07:56:58)