Mikkel Grum | 13 Oct 18:41 2013
Picon

RODBC not connecting from my Mac

iODBC appears no longer to come standard with OSX, so I installed unixodbc and set it up following
instructions here: http://www.boriel.com/en/2013/01/16/postgresql-odbc-connection-from-mac-os-x/

I connected to my remote database with isql -v mydsn. No problem. Then I tried from R:

> library(RODBC)
> pg <- odbcConnect("mydsn")  # waited for a couple of minutes before pressing Ctrl-C
^C
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()[1:2]
Warning messages:
1: In odbcDriverConnect("DSN=mydsn") :
  [RODBC] ERROR: state IM002, code 1606406032, message [iODBC][Driver Manager]Data source name not
found and no default driver specified. Driver could not be loaded
2: In odbcDriverConnect("DSN=mydsn") :
  [RODBC] ERROR: state IM002, code 1606406032, message [iODBC][Driver Manager]Data source name not
found and no default driver specified. Driver could not be loaded

It looks like RODBC might only work with iODBC on the Mac. Is that the case? I haven't been able to configure
iODBC correctly, and therefore haven't been able to test whether that would work with RODBC. Any chance
that I can get RODBC to work with unixodbc? Any other information that would be useful in resolving it?

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] C/UTF-8/C/C/C/C

attached base packages:
(Continue reading)

Magnus Thor Torfason | 1 Oct 14:45 2013
Picon

RMySQL "lost connection" during dbWriteTable()

When doing dbWriteTable() to write my (admittedly large) data.frame to a 
MySQL database I randomly get the following error:

 >     dbWriteTable(conn, "tablename", data)
Error in mysqlExecStatement(conn, statement, ...) :
   RS-DBI driver: (could not run statement: Lost connection to MySQL 
server during query)

Googling on MySQL in general suggests that this can be the result of 
sending too big of a chunk of data to MySQL at the same time.

But the data.frame sits comfortably in memory and the table sits 
comfortably in the database. So it is disappointing that what I thought 
was the recommended way to achieve this task (dbWriteTable), should be a 
bottleneck.

I suppose I could write a loop around dbWriteTable(), writing only a few 
rows of the data.frame at the same time, but that seems like something 
that dbWriteTable() should be doing internally.

Are there any good suggestions on what I should do?

Best,
Magnus

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

(Continue reading)

krisan haria | 9 Sep 13:02 2013
Picon

Error in connecting R to Postgre

Hi

I have the following version of R installed

R version 3.0.0

I'm trying to connect this to PostGre Version 1.16.1

I have loaded the package RPostgreSQL

I have then tried to run the following

> drv <- dbDriver("PostgreSQL")
> drv
<PostgreSQLDriver:(8568)>
> con <- dbConnect(drv, dbname="postgres")
Error in postgresqlNewConnection(drv, ...) :
  RS-DBI driver: (could not connect PLAYER <at> local on dbname "postgres"
)

Any idea on what is causing this error?

--

-- 
Dr. Krisan Haria

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
(Continue reading)

Seth Falcon | 7 Sep 19:37 2013
Picon

RSQLite source code has moved to github

Hi all,

I've moved the RSQLite sources to github.

New Location: https://github.com/seth/RSQLite

Old Location: https://hedgehog.fhcrc.org/compbio/r-dbi/SQLite/RSQLite

If you have an issue with RSQLite, please feel free to open an issue via
the github page -- and pull requests are welcome.

+ seth

--

-- 
Seth Falcon |  <at> sfalcon | http://userprimary.net/

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Grant Farnsworth | 6 Aug 02:23 2013
Picon

RSQLite and transparent compression

I frequently create, write to, and read from large SQLite databases
from within R using RSQLite, sometimes across the network.  As
size/performance can be a consideration for me, I find myself wishing
I could compress my sqlite database files and interact with them
directly, the way one can interact with a gzipped text file using
read.table() or scan().  In case anyone wasn't aware, you can read
from a gzipped  text file without any additional arguments

G <- read.table("myfile.txt.gz")

and so forth.

The syntax doesn't have to be that simple, but does anyone know of a
workaround to allow me to read from an SQLite database that has been
compressed?   Or if you have a different solution/workaround, I would
love to hear it.  Thanks!

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Simon Zehnder | 16 Jul 10:39 2013
Picon

Serialize data.frame to database

Dear all,

I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to
store this data to an SQLite database (I might be wrong with this approach and a data.frame can be
efficiently and faster stored and fetched in a database row in a different manner - please feel free to make
suggestions. It is just what I know from Java how to store a matrix). 

This is what I tried to do:

library(RSQLite)
con <- dbDriver("SQLite")
db <- dbConnect(con, "test")
dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)')
data.bin <- serialize(iris, NULL, ascii = FALSE)
dbSendQuery(db, paste("INSERT INTO frames VALUES(1, X'", data.bin, "')", sep = ""))
data.bin2 <- dbGetQuery(db, "SELECT DATA FROM frames WHERE simID = 1")
data.bin2
 data
1   58

So, only the first entry of data.bin is saved to the database. I tried to first convert the binary data to raw data:
data.raw <- rawToChar(data.bin)
Error in rawToChar(data.bin) :
 embedded nul in string: 'X\n\0\0\0\002\0\003\0\001\0\002\003\0\0\0\003\023\0\0\0\005\0\0\0\016\0\0\0\x96 <at> \024ffffff <at> \023\x99\x99\x99\x99\x99\x9a <at> \022\xcc\xcc\xcc\xcc\xcc\xcd <at> \022ffffff <at> \024\0\0\0\0\0\0 <at> \025\x99\x99\x99\x99\x99\x9a <at> \022ffffff <at> \024\0\0\0\0\0\0 <at> \021\x99\x99\x99\x99\x99\x9a <at> \023\x99\x99\x99\x99\x99\x9a <at> \025\x99\x99\x99\x99\x99\x9a <at> \023333333 <at> \023333333 <at> \021333333 <at> \027333333 <at> \026\xcc\xcc\xcc\xcc\xcc\xcd <at> \025\x99\x99\x99\x99\x99\x9a <at> \024ffffff <at> \026\xcc\xcc\xcc\xcc\xcc\xcd <at> \024ffffff <at> \025\x99\x99\x99\x99\x99\x9a <at> \024ffffff <at> \022ffffff <at> \024ffffff <at> \023333333 <at> \024\0\0\0\0\0\0 <at> \024\0\0\0\0\0\0 <at> \024\xcc\xcc\xcc\xcc\xcc\xcd <at> \024\xcc\xcc\xcc\xcc\xcc\xcd <at> \022\xcc\xcc\xcc\xcc\xcc\xcd <at> \023333333 <at> \025\x99\x99\x99\x99\x99\x9a <at> \024\xcc\xcc\xcc\xcc\xcc\xcd <at> \026\0\0\0\0\0\0 <at> \023\x99\x99\x99\x99
 \x99\x9a <at> \024\0\0\0\0\0\0 <at> \026\0\0\0\0\0\0 <at> \023\x99\x99\x99\x99\x99\x9a <at> \021\x99\x99\x99\x99\x99\x9a <at> \024ffffff <at> \024\0\0\0\0\0\0 <at> \022\0\0\0\0\0\0 <at> \021\x99\x99\x99\x99\x99\x9a <at> \024\0\0\0\0\0!
 \0

I don't know what this error should tell me. Then I tried to use the ASCII format

data.ascii <- serialize(iris, NULL, ascii = TRUE)
(Continue reading)

Daniel Reis | 11 Jul 21:29 2013

[RODBC] Error (ORA-12560 ) when trying to connect to Oracle database

Hello,

I installed the Oracle 11g client on my machine, and tested the
connection to my target Oracle database through MS Access. All seems to
be working fine.

When I try to connect to the very same DB using R with:

channel <- odbcConnect(dsn="MyDSN", uid="XXXXX", pwd="XXXXXXXX",
believeNRows=FALSE)

I get the following error:

In odbcDriverConnect("DSN=MyDSN;UID=XXXX;PWD=XXX",  :

[RODBC] ERROR: state HY000, code 12560, message
[Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error

Am I missing the installation of some component/driver? I read something
about installing the Oracle Instant Client (free) but thought the Oracle
11g client would be sufficient. What am I missing?

Dan

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db
(Continue reading)

Chris Colburn | 9 May 14:48 2013
Picon

RODBC error when connecting to postgres

Hello All,

I’m trying to connect via ODBC to a postgres database. Although I’ve been
able to test my ODBC configurations using isql I am now getting the
following error in R.  This seems like a memory issue, but cannot tell if
the ‘calloc’ error is a red herring.  Let me know if you need any more
information.  Many thanks in advance!

> library(RODBC)> myconn <- odbcConnect("postgres_dsn", uid="test",
pwd="<PASSWD>")
> sqlQuery(myconn,"select count(*) from test_table;")
Error in odbcQuery(channel, query, rows_at_time) :  'Calloc' could not
allocate memory (18446744073709551616 of 22816 bytes)

> versionplatform       x86_64-suse-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          3
minor          0.0
year           2013
month          04
day            03
svn rev        62481
language       R
version.string R version 3.0.0 (2013-04-03)
nickname       Masked Marvel

Any help that you can provide is greatly appreciate, and I will try to
(Continue reading)

Dirk Eddelbuettel | 23 Apr 15:22 2013
Picon
Gravatar

Re: GSoC R project (Port pymssql core to R)


Hi Taras,

On 23 April 2013 at 16:05, Taras Murzhiev wrote:
| Hi Dirk,
| 
| My name is Taras Murzhiev, I am a last-year student from Ukraine and want to
| participate in Google Summer of Code this year.
| I have experience in programming (C++, Python, less Matlab and R) and math with

For this project, you may to look a little at the R packages (all on CRAN)

    DBI	 	  -- generic database interface

    RSQLite	  -- use DBI to access SQLite
    RMySQL	  --  "   "   "    "   MySQL
    RPostgreSQL   --  "   "   "    "   PostgreSQL
    ROracle       --  "   "   "    "   Oracle

depending on what backend you have. SQLite does NOT need a server and is
easiest to get going.

| theory background.
| 
| I'm interested in working on project 'Port pymssql core to R and DBI as
| RMSSql' that you proposed on GSoC R wiki page.
| It would be very pleasant if you could briefly describe main goals, expectation
| and usage aspect of this project and your vision of techical side and
| implementation details that give me ability to go forward.

(Continue reading)

Paul Gilbert | 5 Apr 19:32 2013
Picon

RMySQL cannot allocate a new connection

  I have recently started getting error messages

Error: RS-DBI driver: (d/mysqld.sockcannot allocate a new connection -- 
maximum
of 16 connections already opened)

The server has a max connections set to 500, which is verified from the 
R session with

    mysqlQuickSQL(ets, "show variables;")

so the error message does not seem to be reflecting the real problem. I 
am also getting

Warning in mysqlQuickSQL(conn, statement, ...) : pending rows
Warning in mysqlFetch(res, n, ...) :
   RS-DBI driver warning: (error while fetching rows)

I am using  RMySQL 0.9-3 (on Ubuntu)  and am now using R-3.0.0 but the 
problem started before the new R version.  The same code did work in the 
past (circa Dec 2012), but I'm not certain about the version numbers 
then. I've probably upgraded my server since then too.

Does anyone know how to deal with this, or what the cause is?

Is anyone else having a similar problem?

Thanks,
Paul

(Continue reading)

Mark Nadel | 2 Apr 19:09 2013

RODBC Filemaker connection on a Mac

I am trying to communicate through RODBC with a remote Filemaker database.
Searching the web has turned up a number of recipes, but I have not been
able to make any of them work.
Does anyone currently have RODBC working successfully with a remote
Filemaker database? If so, I would appreciate knowing  what driver you are
using and how you do the necessary setup. The more detailed and explicit
the directions, the better.

Thanks in advance,

Mark

--

-- 
*Mark Nadel*
*Principal Scientist
*
Nabsys Inc.
60 Clifford Street
Providence, RI  02903

Phone   401-276-9100 x204
Fax 401-276-9122

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

(Continue reading)


Gmane