From: Ernesto Jardim (email@example.com)
Date: Tue 25 May 2004 - 19:34:23 EST
I found the dbWriteTable function.
Sorry for the work but I'm still trying to understand how the S4
documentation works. If you do "help(package="RMySQL")" the
"dbWriteTable" method does not exist. It exists a "dbReadTable" method
wich has an alias to "dbWriteTable". It should be intuitive but it
wasn't for me ...
Now the method: I could only import 555 rows ... Is there some flag
about the number of rows it can import ?
On Mon, 2004-05-24 at 22:44, David James wrote:
> The method for dbWriteTable() uses the MySQL bulk loading faciliy
> "LOAD DATA LOCAL INFILE" to efficiently upload a file into the
> server. So you should be able to issue something like
> > sim.result <- big.simulation(...)
> > dbWriteTable(con, "table_name", sim.results, append = TRUE)
> to append the rows in sim.results into the MySQL "table_name".
> However, I should mention that the currently implementation
> outputs the contents of the data.frame into a temporary file
> using the function write.table(), which in the past could be
> Hope this helps,
> Ernesto Jardim wrote:
> > 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 differences between the documents and the packages (RMySQL and
> > DBI). I don't find the methods to write data like "dbWriteTable"...
> > On the other hand I've tryied to build a sql statement to insert data
> > but I'm stucked because of ... who knows, my ignorance probably. I want
> > to take advantage of MySQl INSERT INTO statement that deals with several
> > rows at once to insert a complete data.frame into a table. I've tryied
> > to use "paste" to build the sql string but It works "by column" and I
> > need it "by row" ...
> > The sql systax should be something like:
> > INSERT INTO TABLEA(COL1, COL2, COL3) VALUES
> > (VAL11, VAL12, VAL13),
> > (VAL21, VAL22, VAL23),
> > ...
> > (VALN1, VALN2, VALN3);
> > and I have a data.frame with 3 columns corresponding to that table
> > columns.
> > How can I do this ?
> > Thanks
> > EJ
> > ______________________________________________
> > Rfirstname.lastname@example.org mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Remail@example.com mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:12 EST