脚本的多行字符串应该用三引号""" """扩起来
刚才尝试用在python中 .run 的方式新建分区表,代码如下
import dolphindb as ddb
s2 = ddb.session()
s2.connect("localhost", xxxx, "admin", "123456")
str = ('db3=database("dfs://yearRange")'
'cols=`ts_code`suspend_date`suspend_type'
'types=`STRING`DATETIME`INT'
'tbl=db3.createPartitionedTable(table(1:0,cols,types),`tbl,`suspend_date)')
s2.run(str)
结果报错
RuntimeError: <Server Exception> in run: Function cols is not a binary operator
好像是把cols识别成一个函数了