我有一个要查询的数据集太大而无法存储在我的个人计算机上。我想使用 dbplyr 将数据存储在临时表中,但我在尝试执行此操作时遇到了问题。
这是我的代码:
library("ROracle")
library("dplyr")
## Let dbplyr know that we're in an Oracle environment
sql_translate_env.OraConnection <- dbplyr:::sql_translate_env.Oracle
sql_select.OraConnection <- dbplyr:::sql_select.Oracle
sql_subquery.OraConnection <- dbplyr:::sql_subquery.Oracle
## Connect to database
drv = dbDriver("Oracle")
host = "myHost"
port = 1521
sid = "myServerName"
connect.string = paste(
"(DESCRIPTION=",
"(ADDRESS=(PROTOCOL=tcp)(HOST=", host, ")(PORT=", port, "))",
"(CONNECT_DATA=(SID=", sid, ")))", sep = "")
con = dbConnect(drv, username="myUsername", password="myPassword", dbname=connect.string)
## Create the query
remote = tbl(con, "myTable") %>%
filter(GRP_ID == 12345)
## Attempt to run the query and store it in a temporary table, but this fails!
compute(remote)
此代码给了我以下错误消息:
Error in .oci.SendQuery(conn, statement, data = data, prefetch = prefetch, :
ORA-14459: missing GLOBAL keyword
有没有人能够使用 Oracle 数据库和 dbplyr 完成这项任务,如果是这样,您能否分享一下您是如何使其工作的?