'DolphinDB Error: The input argument must be a vector, tuple, matrix, or table

I got this error when inserting a single record to a DFS table: The input argument must be a vector, tuple, matrix, or table. How to add a single record to an existing DFS table? I’ve tried append! and tableInsert, which only worked when inserting multiple records.

Here, I successfully inserted 2 records.

borrow_enabled = 1b 1b
repay_enabled = 1b 1b
status = 0 0
t = table (timestamp, uid, symbol)
dfsTable.append!(t)

But I got the error when there’s only 1 record. The code is shown in the screenshot below:

transferin_enabled = 1b
transferout_enabled = 1b
borrow_enabled = 1b
repay_enabled = 1b
status = 0
t = table (timestamp, uid, symbol)
dfsTable.append!(t)

The error "The input argument must be a vector, tuple, matrix, or table" took place when creating the table. Is there anything I missed?



Solution 1:[1]

I don’t think this issue has anything to do with DFS tables in particular. It’s about how you created the table: repay_enabled = 1b Here repay_enabled is still a scalar. It should be: repay_enabled = [1b] Same with the other columns.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jinzhi