Displaying 20 results from an estimated 4000 matches similar to: "Question: RMySQL bulk load/update one column, dbWriteTable()?"
2010 Oct 13
2
Rmysql - dbWritetable
Dear Rusers,
I am trying to feed my database with data from a file.
But since my file (2010101000.txt) there`s no headers I am facing problem
because the
result data.frame is not separated my columns.
How could I set variables names for each columns in *dbWriteTable*? I have
tried the command below but I don`t know how to fill the *field.type*option.
dbWriteTable(con, "b20101010",
2008 Apr 11
1
SQL INSERT using RMySQL
Hi All,
I've finally gotten around to database access using R. I'm happily
extracting rows from a MySQL database using RMySQL, but am having
problems appending rows to an existing table.
What I *want* to do is to append rows to the table, allowing the
database to automatically generate primary key values. I've only
managed to add rows by using
dbWriteTable( con,
2007 May 31
1
RMySQL DBI question
Dear colleague,
I have two data frame which I tried to use dbWriteTable function with
append=TRUE to write to the mysql database.
The problem is that if I am run my R script directly then it is fine. Both
data frame got written into the database. But when I tried to embed the
script to be called as system("R --save < whatever.R") in my perl script, I
saw very strange things.
One
2010 Jan 27
2
RMySQL - Bulk loading data and creating FK links
I have a table (contact) with several fields and it's PK is an auto
increment field. I'm bulk loading data to this table from files which if
successful will be about 3.5million rows (approx 16000 rows per file).
However, I have a linking table (an_contact) to resolve a m:m
relationship between the an and contact tables. How can I retrieve the
PK's for the data bulk loaded into
2007 Mar 20
1
RMySQL load error
I'm having trouble getting RMySQL to load. I was able to build it and install
it (RMySQL_0.5-11.tar.gz). I was also able to build and install mysql-5.0.37.
I've read many postings about this but have not found a mention of my
particular problem (some closely related). I get the "unable to load shared
library, no such file" error, but all the files do exist, RMySQL.so and
2012 Jun 12
1
Not able to write to PostgreSQL database using "dbWriteTable"
Dear R User's
Please help me to debug this issue. I am trying to write some data ( i=
6) to PostgreSQL database, but it not writing.
Is there any issue in the way I use "dbWriteTable"?
++++++++++++++++++ Source Code ++++++++++++++++++++++++
library("DBI")
library("RPostgreSQL")
drv1 <- dbDriver("PostgreSQL")
i=6
connAE1 <- dbConnect(drv1,host
2008 Nov 06
1
RMySql inserts \r when using dbWriteTable
I am using R 2.8 and the latest versions of RMySQL on a Windows XP 64 bit
machine.
I was wondering if someone could help me figure out how to use dbWriteTable
without inserting \r into my table. Consider the following code snippet,
which is
run after I connect to my database.
myDFOut = dbReadTable(conn, "myDF")
print(myDFOut)
myDFIn = data.frame(x=paste("x", 1:5, sep =
2010 Jul 16
1
Troubles with DBI's dbWriteTable in RMySQL
I am feeling rather dumb right now.
I created what I thought was a data.frame as follows:
aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id)
m_id_default_res <- do.call(rbind, aaa)
print("==========================================")
m_id_default_res
print("==========================================")
ndf <- m_id_default_res[, c('mid',
2005 Mar 09
1
RMySQL installed but not availalable
I don't use MySQL but I have seen messages like this before. They often have replies which indicate that you need to follow the instructions more closely. I suggest you search the list for these previous posts as I'm sure there is help there, somewhere!
Tom
> -----Original Message-----
> From: Adriano von Sydow [mailto:pdasilva at xtra.co.nz]
> Sent: Thursday, 10 March 2005 5:13
2007 Jun 04
2
RMySQL question, sql with R vector or list
Hi,
I am trying to write a RMySQL sql script inside R such that part of the SQL
would be R list or vector. For example, I want to select * from Atable
where ID would equal to a members of R list or vector of "1, 2, 3". Here
the ID list was generated inside R and then try to feed to mysql to call to
get additional data sets.
Can someone on the list help?
Thanks.
--
Waverley @ Palo
2007 Sep 27
1
RMySQL NA/NULL value storage error
Greetings all,
I am running R 2.5.1, RMySQL 0.6 , and DBI 0.2-3 on Windows XP
Like others, I am having trouble with NA/Null value conversions between R
and a MySQL database via DBI, but I could not find my exact problem in the
archives. Most of the time NA values in R get transferred correctly to the
database and back again, unless (apparently) if they are in the last column
of the table being
2011 Feb 09
2
Insert variable in RMySQL-Statement
Dear list,
I'm working with a MySQL-Table and would like to extract selected ids that are stored in a vector:
Ids <- c(1,2,3)
How do I insert this variable in a for loop like this:
For (a in values) {
Temp <- dbGetQuery(con,
"select * from db
Where id = <ID>";)
}
My problem is to split the select-statement and insert the current id. How can I handle this problem?
2009 May 05
1
RMySQL insert statements?
Heya Folks,
I can not find anything on executing insert statement through RMySQL,
can someone please enlighten me?
All i've found so far on getting data into a database is the write
table functionality. Reading all data into memory appending additional
information and writing that into a table is fine on my test
environment, but won't be possible on the production environment
because of
2006 May 23
1
RMySQL on Mac OS 10.4
I have been having trouble getting RMySQL to work on Mac OS 10.4. It
was working fine for me about a year ago but I didn't touch it for a
while and several upgrades of R, MySQL, and OS X later, it is not
working.
I first had the problem that others have been having getting the
error discussed in https://stat.ethz.ch/pipermail/r-sig-mac/2005-
November/002435.html saying that
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users,
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.
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 <-
2001 Mar 19
3
generic database access methods
I've been putting together a package that defined generic methods for
database access. The packages is called "Rdbi." It borrows as much as
possible from existing database packages / proposals. I'd like to start
a discussion about the proposed interface. Here's what I've come up
with so far:
#
# Rdbi: connectionMethods.R
#
dbConnect <- function(dbObj, ...)
2007 Jan 03
2
loading data and executing queries with R and Mysql
Hello everyone,
I have a problem when I execute queries using R 2.3.1 and MySql server 5.0.
What I do: I load data in different csv files (every file represents a
particular temporal step of a simulation) using Mysql query "load data" with
RMySQL command DbSendQuery (but the same problem there is also using
DbWritetable). Then I use a function where I have a lot of queries that
interact
2009 Aug 07
1
RMySQL - overwrite record, not table
Hi, useR-
In RMySQL, how do I overwrite records? (equivalent to "replace" query).
For example, suppose that dat2 is a newer data.frame than dat1.
con <- dbConnect(MySQL())
res <- dbWriteTable(con, "DBname", dat1, row.names=F, append=T, replace=T)
res <- dbWriteTable(con, "DBname", dat2, row.names=F, append=T, replace=T)
This would not update/replace the
2010 Mar 24
1
Bulk editing of mySQL tables
Hello,
I have started to use RMySQL and I would like to use R to make batch
changes to data. What it the best way to do this? Is it to download
the table using dbGetQuery, manipulate the data in R and then
dbWriteTable to delete the existing table and replace it with the local
data.
What I am concerned about this is that it might lose some mySQL table
configuration options and it isn't a
2004 May 24
1
RMySQL problem
Hi,
I'm using R 1.9.0 with RMySQL 0.5-4 and MySQL 3.23.55 on a suse 8.2 box.
I have a simulation study and (as usual for newbies in simulation, I
guess) I have a lot of data that I want to store in MySQL. I want to
write an R script that reads data from RData files and writes it to a
MySQL database.
I read some R documents (R Data Import/Export and DSC papers) but I'm
finding