SQL 解析报错:Assignment statement failed probably due to invalid indices

为什么下述代码执行报错:orders = select SecurityID,FactorID,FactorValue from loadTable("dfs://Factor10MinSH", "Factor10MinSH") where Date == keyword_date => Assignment statement failed probably due to invalid indices [orders = select SecurityID,FactorID,FactorValue from loadTable("dfs://Factor10MinSH", "Factor10MinSH") where Date == keyword_date]

keyword_date=2020.01.01
for (universe in ['SZ', 'SH']){
    if(universe == 'SZ'){
        
        orders = select SecurityID, FactorID, FactorValue 
            from loadTable("dfs://Factor10MinSZ", "Factor10MinSZ") 
            where Date = keyword_date
    }
    if(universe == 'SH'){
        
        orders = select SecurityID, FactorID, FactorValue 
            from loadTable("dfs://Factor10MinSH", "Factor10MinSH") 
            where Date = keyword_date
    }
    undef(`orders)   
}
请先 登录 后评论

1 个回答

saki

循环体内使用了 undef 所以造成解析异常,因为 go 在 for 循环中不起效,且变量可以重复赋值,所以可以把这句语句删除,或者挪到循环体外。具体说明可以参考 https://ask.dolphindb.net/question/77 


请先 登录 后评论