每当我尝试执行数据函数强制它在Spotfire Server上运行时,我都会遇到一个常量错误。
如果运行位置配置设置为"强制本地"该脚本在R Studio和Spotfire上工作正常。或"默认"。
当我使用Force Server时,执行查询时收到以下错误消息:
Could not execute function call. TIBCO Spotfire Statistics Services returned an error:
'Error in sqlQuery(myconn, mappingQuery, errors = TRUE, rows_at_time = : first argument is not an open RODBC channel'.
at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteFunctionClient.OnExecuting(FunctionClient funcClient)
at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.<RunFunction>d__0.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__0.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__6.MoveNext()
即使我有一个简单的脚本和查询,如下所示,结果是相同的:
require(RODBC)
myconn <- odbcDriverConnect("Driver={SQL Server};Server=MY_SERVER;Database=MY_DATABASE;Trusted_Connection=True")
# myconn <- odbcDriverConnect("Driver={SQL Server};Server=MY_SERVER;Database=MY_DATABASE;UID=MY_USER;Pwd=MY_PASSWORD") ## Same result with trusted connection or user/password
query <- "SELECT * FROM MY_TABLE"
df <- sqlQuery(myconn, query)
print(df)
有没有人见过这个?
谢谢!
答案 0 :(得分:0)
该错误似乎表明“ RODBC”包的“ odbcDriverConnect()”函数可能在安装TIBCO Spotfire Statistics Services(TSSS)的服务器上找不到所需的ODBC驱动程序。
尝试在安装TIBCO Spotfire Statistics Services的计算机上安装所需的odbc驱动程序。