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
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:
?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
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("
4 matches
Mail list logo