我使用RODBC::sqlQuery
MERGE "mytable" AS Target USING ( VALUES ('myname','POLYGON ((148.0000000000000000 -20.0000000000000000, 148.0000000000000000 -20.0000000000000000, 148.0000000000000000 -20.0000000000000000, 148.0000000000000000 -20.0000000000000000, 148.0000000000000000 -20.0000000000000000))')) AS Source ("name","polygon")
ON (Target."name" = Source."name")
WHEN MATCHED THEN
UPDATE SET Target."polygon" = Source."polygon"
WHEN NOT MATCHED BY TARGET THEN
INSERT ("name","polygon")
VALUES (Source."name", Source."polygon")
OUTPUT $action, Inserted.*, Deleted.*
row_at_time
sqlQuery
的参数超过10时失败,
Error in odbcQuery(channel, query, rows_at_time) :
'Calloc' could not allocate memory (107374182400 of 1 bytes)
但是如果row_at_time
< 10.(仍然查询需要相当长的时间,这是令人惊讶的,因为表被索引并且非常小:少于100行)
知道为什么吗? 谢谢
编辑:这是我写的表的结构: