Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
myconn<-odbcConnect("testdata") sql.select<-paste("select UNIT_ID from UNITS where (UNIT_TYPE='",unit,"' and COMMUNITY='",property,"')",sep="") unit_ids<-sqlQuery(myconn,sql.select,as.is=TRUE) This should works if myconn and sql.select are defined properly Andrija On Jun 7, 2013 9:58 PM, "Sneha

Re: [R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
tried as.is ,gives an error, [1] "01000 10054 [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send())." [2] "[RODBC] ERROR: Could not SQLExecDirect 'select UNIT_ID from UNITS where (UNIT_TYPE='1X1' and COMMUNITY='SAN1193')'" On Fri, Jun 7, 2013 at 3:21 PM, andrija djurovic wrote:

Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
?sqlQuery as.is - argument Andrija On Jun 7, 2013 9:10 PM, "Sneha Bishnoi" wrote: > Hey all! > > I am trying to select a bunch of id's (data type -character) from a table > and store them in a variable in R > But when i do this, it automatically truncates the leading zero's in id's > even though

[R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
Hey all! I am trying to select a bunch of id's (data type -character) from a table and store them in a variable in R But when i do this, it automatically truncates the leading zero's in id's even though they are of character type. code is :- >myconn<-odbcConnect("testdata") >sql.select<-paste("