similar to: SQL INSERT using RMySQL

Displaying 20 results from an estimated 1200 matches similar to: "SQL INSERT using RMySQL"

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 =
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
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 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 Jun 06
2
Merging two dataframes
Hi All, Newbie question for you all but i have been looking at the archieves and the help dtuff to get a rough idea of what i want to do I would like to merge two dataframes together based on a keyed variable in one dataframe linking to the other dataframe. Only some of the cases will match but i would like to keep the others as well. My dataframes have 67 and 28 cases respectively and i would
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',
2007 Jun 06
1
Question: RMySQL bulk load/update one column, dbWriteTable()?
Hi, I have a question reading using RMySQL trying to load one R vector into a table column. To be more specifically, the table is there populated. Now I add a new column and want to populate this. Can some colleagues on this list teach me how to do this? I know how to write one R object/table into MYSQL table using dbWriteTable. But in this situation, I just want to do one column. Thanks
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
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
2010 Jan 25
1
RMySQL Append data.frame to table
I have a data.frame obj with 5 columns whose colnames match the fields in my "contact" table. The only other field my MySQL table has is an id field which is the PK and is set to auto increment. I'd like to load this data.frame using something like: dbWriteTable(con, "contact", dat, append=TRUE) However, I get this error: Error in mysqlExecStatement(conn, statement,
2003 Nov 24
1
RMySQL valid field names
I'm having some problems with valid field names when using RMySQL to interface R (version 1.7.0, under RedHat9.0), to MySQL (4.1.0-alpha). I think I've spotted the problem and a solution (which is working for me), but I wanted to share this with you as I may be missing something. (Note: I'm aware that this is an old R version, but I've checked the code of the lastest version of
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
2006 Jun 13
2
Numerical print format and loading with RMySQL
Hi I'm new to R and have been resisting posting to the list thus far, but I think I've exhausted my work around options. I'm having a few problems with RMySQL and/or it's underlying packages. I'm doing a very simple vsn transformation on large datasets, using RMySQL to retrieve the data for a DB. My first problem was that I could not get the RMySQL package to write
2002 Dec 18
1
A little problem handling logicals in RMySQL under R1.6.1
There is a little problem in handling logicals in RMySQL: # here is the MySQL connection > con <MySQLConnection:(1816,0)> # here is the data frame > print(a<-data.frame(x=c(TRUE,FALSE),y=c(FALSE,TRUE))) x y 1 TRUE FALSE 2 FALSE TRUE # as promised, the two data frame columns are identified as logicals and # the field types are set to tinyint > field.types <-
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
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
2011 Jul 24
1
Histogram of a dataframe subset failing
Like most help forum users, I'm very new to R. I've been having this problem: I started with a dataframe called fullData. With the subset command, I split it into two separate dataframes, soloData and teamData. The hist() function works when I use... hist( subset(fullData, fullData$playlist_id==4 )$deaths) ...the exact call to subset() that I used to create each dataframe. However,
2005 Dec 30
9
SELECT MAX
How does one do a SELECT MAX query in rails? I''ve searched and searched and tried lots of things with no luck. I want to implement "SELECT MAX(column_name) from table_name and have it return the maximum value from column_name. I just need to get that one value, not the whole object... Thanks for any ideas... Shelby _______________________________________________ Rails mailing
2006 Mar 23
1
RMySQL's column limit
Dear R-users, First, thank you to the developers for the very useful R-library RMySQL. While using this library a recieved an error message: RS-DBI driver: (could not run statement: Too many columns) The statement that generated the error was: dbWriteTable(dbcon, "simdataseries", template, overwrite = TRUE, row.names = FALSE ) I am assuming this is a RMySQL rather than MySQL limit.
2004 May 25
0
RMySQL problem - SOLVED
Hi, The problem was the row.names that were sent to the database and created an primary key duplicate. Now it works fine. BTW congratulations for the package. It copied 15300 rows by 11 columns in less than 5 seconds, in my PIII 833 with 1 GB RAM. > system.time(dbWriteTable(con, "TBL_SIMDATA", TBL.SIMDATA, append = TRUE, row.names=F)) [1] 3.87 0.05 4.86 0.01 0.00 Just one