similar to: RODBC query on one line

Displaying 20 results from an estimated 10000 matches similar to: "RODBC query on one line"

2012 Jul 30
1
why querying Sybase IQ using RODBC returns error ?
Hello, I am not able to query Sybase IQ database from R using RODBC package. Check the below code R> sybaseiq.query <- function (sql, ..., as.is = FALSE) { connstr <- "Driver={Sybase IQ};UID=ajadhav2;PWD=*****;ServerName=PSGSESHR01A_IQ;CommLinks=SharedMemory,TCPIP{host=psgseshr01_iq.sg.csfb.com;port=3051}" chan <- odbcDriverConnect(connstr)
2007 Nov 24
2
truncated fields with RODBC
I'm changing some functions from storing data in SQLite (using RSQLite) to storing it in PostgreSQL (using RODBC). When trying to store very long character fields I get the following message: > sqlSave(pg, Grids, rownames = FALSE, append = TRUE) Warning messages: 1: In odbcUpdate(channel, query, mydata, paramdata, test = test, verbose = verbose, : character data truncated in column
2012 May 04
1
Why does RODBC driver returns garbage from Sybase server on new windows 7 machine?
Hi, I am trying to query a Sybase database on my new windows 7 machine. I am using native sybase driver "Adaptive server Enterprise" following is example code conn <- sprintf("driver=Adaptive server Enterprise;server=PHKSESMD01;database=smd_live;uid=temp_user;password=temp_pass;port=2301") chan <- odbcDriverConnect(conn) x <- sqlQuery(chan,sql,as.is=as.is)
2010 Feb 16
1
RODBC missing values in integer columns
Hello, We are having some strange issues with RODBC related to integer columns. Whenever we do a sql query the data in a integer column is 150 actual data points then 150 0's then 150 actual data points then 150 0's. However, our database actually has numbers where the 0's are filled in. Furthermore, other datatypes do not have this problem: double and varchar are correct and do not
2011 May 02
2
INSERT OR UPDATE
I'm trying to insert rows of a data.frame into a database table, or update where the key fields of a record already exist in the table. I've come up with a possible solution below, but would like to hear if anyone has a better solution. # The problem demonstrated: # Create a data.frame with test values library(RODBC) tbl <- data.frame( key1 = rep(1:3, each = 2), key2 =
2006 Jan 27
3
substituting an object not found
Is there any function in R like is.not.found(x, y) meaning if you can't find object x, then use object y?? Mikkel Grum
2010 Dec 28
4
batch file output
I run a batch file with the following command in Windows XP: C:\R\R-2.12.1\bin\Rterm.exe --no-save --no-restore <C:\users\me\file.R> C:\users\me\file.out 2>&1 Is there any way to get only the output of R in file.out, without getting all the code from file.R too? Any help greatly appreciated, Mikkel
2006 Feb 27
4
prepared query with RODBC ?
Dear List, Would anyone know how to perform prepared queries with ROBC ? I had a shot with some of the internal (non-exported) functions of the package but ended up with a segfault, so I prefer asking around before experimenting further... Thanks, Laurent
2007 Dec 30
3
Date formats
Is the following expected behaviour for a date used in an ifelse function? > date <- Sys.Date() > date [1] "2007-12-30" > ifelse(TRUE, date-1, date) [1] 13876 > ifelse(FALSE, date-1, date) [1] 13877 > ifelse(TRUE, as.character(date-1), date) [1] "2007-12-29" > if (TRUE) {date} [1] "2007-12-30" It would seem more natural to me if a date produced
2006 Jan 02
1
"7:9, 12:14" in dataframe to c(7:9, 12:14)
I want to do something like df[df$b %in% df2[i, 2], ] where df$b is a numeric vector and df2[i, 2] is a factor with levels like "7:9, 12:14". For example: a <- c(paste("A", 1:10, sep = ""), paste("B", 1:10, sep = "")) b <- 1:20 df <- as.data.frame(cbind(a, b)) df$b <- as.numeric(levels(df$b))[as.integer(df$b)] f <-
2004 Dec 31
2
Supressing empty sections with Sweave
Dear useRs, I'm writing regular survey reports using Sweave. Each report has several sections along the lines of: \section*{Disease X} <<MapX,fig=TRUE,echo=FALSE>>= image(vectorx,vectory,matrixz) @ Notes with or without Sexpr{a}. \vfill \pagebreak \section*{Disease Y} <<MapY,fig=TRUE,echo=FALSE>>= ...etc. Often one or more of the diseases is not observed (all
2007 Aug 07
2
backslash c
How do I get output with "\color{blue}", i.e. with only one backslash??? > "\color{blue}" [1] "color{blue}" Warning messages: 1: '\c' is an unrecognized escape in a character string 2: unrecognized escape removed from "\color{blue}" > "\\color{blue}" [1] "\\color{blue}" > Any help greatly appreciated. Best regards,
2008 Jul 28
4
RODBC to query an Oracle table
Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or tell me if I am going about this the correct way that would be greatly appreciated! The script I have right now is: >require(RODBC)
2002 May 30
2
RODBC & Problems with Sybase Database
Hello, i would like import Data from Sybase DataBase to R-1.5.0 via RODBC. With this i get a connection without problems ! channel <- odbcConnect("ODBCName","LoginName","LoginPass") dataSybase <- sqlFetch(channel,"EPORT_XYZ") ,but when i try this i get a message error ? (Perhaps the _ is a problem, i know that's i.e. not usual to name
2011 May 25
1
Time and db precision
I have a loop that regularly checks for new data to analyse in my database. In order to facilitate this, the database table has a timestamp column with the time that the data was inserted into the database. Something like this: while (....) { load(timetoken.Rdata) df <- sqlQuery(con, paste("SELECT * FROM tabledf WHERE timestamp > ", timetoken, sep = ""))
2005 Jun 01
3
x[x$a=="q",,drop=TRUE]
I'm trying to select a subset of a dataframe while dropping some factors. While the dataset gets smaller all Factor levels remain and I need to get rid of them. Strangely enough, I am almost certain that the same code on the same data worked OK earlier today - and it is not the first time that I'm not able to replicate earlier results with this command (I know, I might just be going
2002 Jan 08
6
Subsets without NA
Is there a way of removing all rows with missing values from a data frame? I usually use subset(x, var1!="NA") and repeat for each variable. It would be nice to be able to do it in one fell swoop. Also, surprisingly, it doesn't always work. Sometimes I'm left with an empty set even though not all rows have missing values for the variable. Cheers, mikkel Mikkel Grum,
2001 Aug 13
3
subset syntax
Can anyone tell me what's wrong with this command?? xx<-subset(x,LOCAL.NAME==c("Chifumbata","Chikota"),select=c(13,16,19,23,26,2 9,30,33:48)) Warning message: longer object length is not a multiple of shorter object length in: LOCAL.NAME == c("Chifumbata", "Chikota") both of the following commands work fine
2003 Sep 02
1
Plotting dates
I'm trying to plot observations against observation dates and getting julian dates along the x-axis: library(date) Week<-as.date(c("05/02/03","05/09/03","05/16/03","05/23/03","05/30/03","06/0 7/03","06/14/03")) Leafminers<-c(0,2,5,10,4,6,5) Diglyphus<-c(0,0,4,5,7,3,1) LeafDig<-cbind(Week,Leafminers,Diglyphus)
2017 Nov 14
1
Dates to numeric in for loop
Hi Can anyone explain why a date becomes numeric when you loop over a series of dates? > dt <- Sys.Date() > dt [1] "2017-11-14" > class(dt) [1] "Date" > dts <- dt - 1:0 > class(dts) [1] "Date" > > for (i in dts) { + print(i) + print(class(i)) + print(as.Date(i, "1970-01-01")) + print(class(as.Date(i,