[R-sig-DB] binding variable in sqlQuery

d. sarthi maheshwari @@m@y@@@r @end|ng |rom gm@||@com
Tue Dec 5 09:51:29 CET 2006


Dear Sir/Madam,

How can we bind a variable value with sqlQuery. For example:

i am trying to run following command ::

library(RODBC)
inchannel <- odbcConnect("my_server", uid="samay")
sqlQuery(inchannel, 'select item1, item2 from _my_table
            where item3 >= 10
            and dbid = 10')

however for introducing flexibility i want to write this command as

my_value = 10
library(RODBC)
inchannel <- odbcConnect("my_server", uid="samay")
sqlQuery(inchannel, 'select item1, item2 from _my_table
            where item3 >= 10
            and dbid = my_value')


How can I bind the my_value with the query in sqlQuery?

Please suggest and help me. I am in need.

-- 
...I am learning from my life...

s..a..r

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list