1
 loannumber<-sqlQuery(ch,"SELECT LOAN# FROM srvdsrl1")

This is an ODBC table and field name is LOAN#

This is the error

[1] "42S22 1054 [MySQL][ODBC 5.3(w) Driver][mysqld-5.6.22]Unknown column 'LOAN' in 'field list'"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT LOAN# FROM srvdsrl1'"   
Metrics
  • 15,172
  • 7
  • 54
  • 83
Mooody80
  • 15
  • 3

1 Answers1

0

It is more a database issue than R. In case of MySQL (as can be deducted from the error description) columns with special characters should be quoted: 'LOAN#'. See Special Characters in MySQL Table Name

Community
  • 1
  • 1
bergant
  • 7,122
  • 1
  • 20
  • 24