How to append an array vector to a database?

11 Views Asked by At

I added a column to the TSDB table pt using addColumn(pt, `sessions, SECOND[]). So, how should I write the data [14:30:00,15:00:00] into the session column of pt?

Only TSDB tables support the SECOND[] type, but the data must first be appended to an in-memory table, which may not support SECOND[].

1

There are 1 best solutions below

0
jinwandalaohu On

The in-memory table supports ARRAY VECTOR. You must follow the syntax of the append! function when appending the data. In this case, the array vector [14:30:00,15:00:00] should be wrapped with [].

Please refer to the following method:

For example:

time = array(SECOND[]).append!([[14:30:00,15:00:00]])
t = table(time)

See also: https://docs.dolphindb.com/en/Functions/a/append!.html?hl=append