问题
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