similar to: RMySql inserts \r when using dbWriteTable

Displaying 20 results from an estimated 1000 matches similar to: "RMySql inserts \r when using dbWriteTable"

2008 Aug 11
1
Unwanted carriage returns storing dataframes with dbWriteTable
If I save a dataframe with a character-typed last column to a relational database with dbWriteTable, the values in the last column of the resulting table in the database will have a '\r' (carriage return) appended. If I read back the dataframe with dbReadTable the last column in the resulting dataframe has also '\r' appended (see protocol below). Setting or unsetting sql-mode
2005 Oct 27
2
RSQLite problems
Hi, I'm experimenting with using (R)SQLite to do data management. Here are two little problems that I've encountered: 1. The presence of ',' in string values causes trouble since ',' is also the delimiter used in the SQL statement. 2. A newline '\n' line attached to the last string value of each row. Some examples: > library (RSQLite) Loading required
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 <-
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, ...)
2012 Mar 27
1
RSqlite UPDATE command problem
All: I am using RSqlite and want to be able to update individual values in a record, such as with this simple example: library(RSQLite) drv<-dbDriver("SQLite") con<-dbConnect(drv,"test.db") my.data<-data.frame(countries=c("US","UK","Canada","Australia","NewZealand"),vals=c(52,36,74,10,98))
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
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
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
2011 Jan 04
2
RSQLite to input dataframe
Dear r helpers, At first, I apologize for raising a query which seems to be a stupid interpretation on my part. I am trying to learn SQLite. Following is an example given in the RSQLite.zip file (Page # 4) drv <- dbDriver("SQLite") tfile <- tempfile() con <- dbConnect(drv, dbname = tfile) data(USArrests) dbWriteTable(con, "arrests", USArrests) On the similar
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,
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',
2011 Dec 02
2
help in dbWriteTable
hi I need some help in dbWriteTable. I'm not able to insert the rows in the table if the column order are not same in the database and in the dataframe which i'm inserting. Also facing issue if the table is already created externally and inserting it thru dbWrite. is there some way that we can sepecify the rownames in the dbwrite..or any method which will solve my problem -- View
2017 Aug 29
0
DBI::dbWriteTable syntax error apparently from quotes
Double quotes are not legal SQL syntax. Use single quotes. -- Sent from my phone. Please excuse my brevity. On August 29, 2017 2:21:44 AM PDT, Eric Berger <ericjberger at gmail.com> wrote: >I have been successfully using RODBC for a long time (years) to connect >to >MS SQL Server from R. >This week I wanted to try using odbc but I am seeing some problems >which >may be
2017 Aug 29
2
DBI::dbWriteTable syntax error apparently from quotes
I have been successfully using RODBC for a long time (years) to connect to MS SQL Server from R. This week I wanted to try using odbc but I am seeing some problems which may be related to how I set up my driver and/or connection. The dbWriteTable manual page gives as an example command: dbWriteTable( pDB$con, "mtcars", mtcars[1:5,]) When I try this I get the following error Error:
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",
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
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
2011 Nov 08
1
dbWriteTable with field data type
Hello, When I do: dbWriteTable(con, "r.BOD", cbind(row_names = rownames(BOD), BOD)) ...can I specify the data types such as varchar(12), float, double precision, etc. for each of the fields/columns? If not, what is the best way to create a table with specified field data types (with the RpgSQL package/R)? Regards, Ben [[alternative HTML version deleted]]
2012 Jan 16
1
dbWriteTable(con, access_log, overwrite = F).....
I am new to R. My goal is to make a crosstable from a Apache access.log, which I want to load into PostgreSQL database at first to learn more abour R and DBI and datatypes. When the I have got the access.log in the database I will try to make the crosstable! Trying to load the Apache access.log into PostgreSQL I get an error. dbWriteTable(con, access_log, overwrite = F); returns Error in