Issues connecting R to HANA db with many special characters

大兔子大兔子 提交于 2019-12-13 03:47:29

问题


I am having issues with reading HANA data into R.

I have established my connection via

ch <- odbcConnect("HANA",uid="USER",pwd="PW")

And confirmed I am connected via

sqlTables(ch)

which pulls up my list of tables.

Filtering on my desired table I am trying to pull reveals the full name to be "ccf-edw.self-service.MDM::Q_CA_R_CUSTOMER_REPORTS"

From other posts I have seen, there appear to be issues surrounding the periods.

Attempting

sqlQuery(ch, 'SELECT TOP 10 FROM "_SYS_BIC"."ccf-edw"."self-service"."MDM::Q_CA_R_CUSTOMER_REPORTS"')

Returns error

[1] "42000 257 [SAP AG][LIBODBCHDB DLL][HDBODBC] Syntax error or access violation;257 sql syntax error: incorrect syntax near \"FROM\": line 1 col 15 (at pos 15)"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT TOP 10 FROM \"_SYS_BIC\".\"ccf-edw\".\"self-service\".\"MDM::Q_CA_R_CUSTOMER_REPORTS\"'" 

I am unsure exactly where to stick additional double quotes.


回答1:


Can you try this instead:

sqlQuery(ch, 'SELECT TOP 10 FROM "_SYS_BIC"."ccf-edw.self-service.MDM::Q_CA_R_CUSTOMER_REPORTS"')


来源:https://stackoverflow.com/questions/57498890/issues-connecting-r-to-hana-db-with-many-special-characters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!