ZDF<-sqlQuery(ch_185,"select*from SI_STK_20004 where F_SCODE in (",scode[1],",",scode[2],",",scode[3],") and F_TYPE=999 and F_TRADEDAY between 20150601 and 20150605 order by F_SCODE"),错误是[1] "HY000 936 [Oracle][ODBC][Ora]ORA-00936: 缺失表达式\n"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'select*from SI_STK_20004 where F_SCODE in ('",请问怎样改
你的sql语句不对,建议先去学学paste或sprintf函数的用法吧。
"select*from SI_STK_20004 where F_SCODE in (",scode[1],",",scode[2],",",scode[3],") and F_TYPE=999 and F_TRADEDAY between 20150601 and 20150605 order by F_SCODE"
应该改为
paste("select*from SI_STK_20004 where F_SCODE in (",scode[1],",",scode[2],",",scode[3],") and F_TYPE=999 and F_TRADEDAY between 20150601 and 20150605 order by F_SCODE", ...
你的sql语句不对,建议先去学学paste或sprintf函数的用法吧。
"select*from SI_STK_20004 where F_SCODE in (",scode[1],",",scode[2],",",scode[3],") and F_TYPE=999 and F_TRADEDAY between 20150601 and 20150605 order by F_SCODE"
应该改为
paste("select*from SI_STK_20004 where F_SCODE in (",scode[1],",",scode[2],",",scode[3],") and F_TYPE=999 and F_TRADEDAY between 20150601 and 20150605 order by F_SCODE", sep='')
顺便问问你用的是哪家的财经数据库?