dbi

Error using perl module DBD::mysql in ActivePerl 5.28 on Windws10 64bits

时光毁灭记忆、已成空白 提交于 2021-02-19 08:01:48
问题 I installed the new ActiveState Perl custom build with Perl 5.28 and I added the module (DBD-mysql v4.50). The DBI module is set by default to the ActivePerl 5.28 compilation. use strict; use warnings; use diagnostics; use DBI; ### INIT DB CONNECTION my $dbh = DBI->connect("DBI:mysql:database=testdb;host=localhost","root", "XXXX",{'RaiseError' => 1,'mysql_auto_reconnect' => 1}); $dbh->{InactiveDestroy} = 1; $dbh->{mysql_auto_reconnect} = 1; then I get the following error: >perl test.pl

R, dbGetQuery() will not select records for all values passed in params

这一生的挚爱 提交于 2021-02-11 17:17:18
问题 I am trying to get dbGetQuery to retrieve all rows referenced in a char list (test_ID2) from a SybaseIQ table (test_in). The result is that only the first entry in test_ID2 is retrieved. the dbGetQuery() looks like this: test_con <- DBI::dbConnect(odbc::odbc(), driver = 'SybaseIQ', host = 'xxx.xx.xxx', port = 'xxxx', uid = 'xxxx', pwd = 'xxxx') test_out <- dbGetQuery(test_con,"SELECT * FROM test_in WHERE ID2 = ?", params = list(test_ID2)) test_in looks like this: > test_in ID1 DATE ID2 QTY

R, dbGetQuery() will not select records for all values passed in params

南楼画角 提交于 2021-02-11 17:17:14
问题 I am trying to get dbGetQuery to retrieve all rows referenced in a char list (test_ID2) from a SybaseIQ table (test_in). The result is that only the first entry in test_ID2 is retrieved. the dbGetQuery() looks like this: test_con <- DBI::dbConnect(odbc::odbc(), driver = 'SybaseIQ', host = 'xxx.xx.xxx', port = 'xxxx', uid = 'xxxx', pwd = 'xxxx') test_out <- dbGetQuery(test_con,"SELECT * FROM test_in WHERE ID2 = ?", params = list(test_ID2)) test_in looks like this: > test_in ID1 DATE ID2 QTY

R, dbGetQuery() will not select records for all values passed in params

久未见 提交于 2021-02-11 17:15:49
问题 I am trying to get dbGetQuery to retrieve all rows referenced in a char list (test_ID2) from a SybaseIQ table (test_in). The result is that only the first entry in test_ID2 is retrieved. the dbGetQuery() looks like this: test_con <- DBI::dbConnect(odbc::odbc(), driver = 'SybaseIQ', host = 'xxx.xx.xxx', port = 'xxxx', uid = 'xxxx', pwd = 'xxxx') test_out <- dbGetQuery(test_con,"SELECT * FROM test_in WHERE ID2 = ?", params = list(test_ID2)) test_in looks like this: > test_in ID1 DATE ID2 QTY

Error ORA-12154 on DBI->connect to Oracle database with Oracle Instant Client in Solaris 10

大兔子大兔子 提交于 2021-02-10 18:42:56
问题 I've been pulling my hair out over this problem for two days now: I'm trying to get a perl script to interface with an Oracle database. I have a new server I'd like to deploy my application on. This script previously worked. Here's what I've done so far: Placed my tnsnames.ora file in instantclient/network/admin: ls -la network/admin/ total 8 drwxrwxrwx 2 m staff 512 Apr 19 09:54 . drwxrwxrwx 3 m staff 512 Mar 28 15:56 .. -rwxrwxrwx 1 m staff 777 Apr 19 09:54 tnsnames.ora My Perl script looks

Why can I not use dbWriteTable for SQL Server?

此生再无相见时 提交于 2021-02-08 10:42:29
问题 Does anyone know if something would have changed to break it? or am I missing something? data <- data.frame(x = rnorm(10), y = rnorm(10)) cxn <- DBI::dbConnect(odbc::odbc(), driver = 'ODBC Driver 17 for SQL Server', server = dbServer, database = dbName, trusted_connection = 'yes', port = port) DBI::dbWriteTable(cxn, tblName, data, append = T) I'm getting the following error: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘dbWriteTable’ for

Why can I not use dbWriteTable for SQL Server?

痞子三分冷 提交于 2021-02-08 10:40:45
问题 Does anyone know if something would have changed to break it? or am I missing something? data <- data.frame(x = rnorm(10), y = rnorm(10)) cxn <- DBI::dbConnect(odbc::odbc(), driver = 'ODBC Driver 17 for SQL Server', server = dbServer, database = dbName, trusted_connection = 'yes', port = port) DBI::dbWriteTable(cxn, tblName, data, append = T) I'm getting the following error: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘dbWriteTable’ for

Optimize/Vectorize Database Query with R

会有一股神秘感。 提交于 2021-01-27 19:42:14
问题 I am attempting to use R to query a large database. Due to the size of the database, I have written the query to fetch 100 rows at a time My code looks something like: library(RJDBC) library(DBI) library(tidyverse) options(java.parameters = "-Xmx8000m") drv<-JDBC("driver name", "driver path.jar") conn<- dbConnect( drv, "database info", "username", "password" ) query<-"SELECT * FROM some_table" hc<-tibble() res<-dbSendQuery(conn,query) repeat{ chunk<-dbFetch(res,100) if(nrow(chunk)==0){break}