在一个字符串类型(不是符号)的表中,我可以逐个插入一行。但批量插入不起作用!
t:([id:`int$()] str:()) /create table
`t insert(0, enlist enlist "test") /insert first row. This seems to need two enlist
`t insert(1, enlist "test1") /insert one more, this time with one enlist
`t insert (2 3; enlist "test2" enlist "test3") /trying to bulk insert fails
`t insert flip (2 3; enlist "test2" enlist "test3") /trying to bulk insert with flip also fails
答案 0 :(得分:1)
我更喜欢使用分号而不是插入命令中的逗号。这使得语法更简单,也使其易于理解。由于逗号语法,在第一次插入时需要2个enlist。
您用于批量插入的语法不正确。它非常简单如下:
q) t:([id:`int$()] str:()) / create table
q) `t insert (0;enlist "test") / insert first row
q) `t insert (1 2;("test1";"test2")) / bulk insert 2 rows