Conversion from a database list produced by DBI/dplyr to a data frame results in the following error:
Error in new_result(connection@ptr, statement, immediate) : nanodbc/nanodbc.cpp:1374: 00000: [SAP][ODBC Driver][SAP IQ]Syntax error near '(end of line)' on line 3
The database I'm using is SAP's Sybase IQ SQL Anywhere 17. Any help you can provide is appreciated. Relevant code is below. Please let me know if I can provide any additional helpful details.
require(odbc)
require(DBI)
require(dplyr)
require(dbplyr)
con <- dbConnect(odbc::odbc(),
driver="/opt/app/SybaseIQ/IQ-16_1/lib64/libdbodbc17.so",
host="host",
server="server",
database="database",
uid="uid",
pwd="pwd")
#Or, alternatively,
con <- dbConnect(odbc::odbc(),
dsn = "dsn",
UID = "uid",
PWD = "pwd")
#This works fine:
irmf_8300 <- tbl(con, "IRMF_F8300")
#This works fine:
few <- irmf_8300 %>%
top_n(2)
#The following statements produce an error
few <- irmf_8300 %>%
top_n(2) %>%
collect()
#or, alternatively,
few <- irmf_8300 %>%
top_n(2) %>%
as.data.frame()