[R] variables inside an Rdi-select statement?!

Stephan Holl sholl at gmx.net
Fri Aug 2 14:35:31 CEST 2002


Dear R-users,

I would like to use an environment variable inside an SELECT-statement
from R to a postgres-db, but it will not work and so I need some advice
from you.
<code>
ezg <- Sys.getenv("EZG")
connect <- dbConnect.PgSQL(host="localhost", user="username",
dbname="dbname")
query <-  dbSendQuery(connect, "SELECT ezg.s FROM ezg  WHERE
ezg.s!='12'")
</code>
the error is, that SELECT searches for the relation ezg, but it should
use value stored in ezg.

Any suggestions?

thanks in advance

stephan


-- 
Linux: the operating system with a CLUE...
         Command Line User Environment.
--------------------------------------
Stephan Holl
GnuPG Key-ID: 11946A09
ICQ# 117277975 
--------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20020802/90badc64/attachment.bin


More information about the R-help mailing list