- Install RPostgreSQL
:library(RPostgreSQL) - Open a db connection using the dbConnect function
:con<-dbConnect(PostgreSQL(),user="xxx", password="xxx",host="localhost", client.flag=CLIENT_MULTI_RESULTS) - Use dbGetQuery to initiate a SELECT and return the result sets
:sql<-"SELECT * FROM table WHERE name='xxx'"
:rows<- dbGetQuery(con,sql) - Use dbDisconnect to terminate the connection
:dbDisconnect(con)
Wednesday, May 30, 2012
R Postgresql
Reading from PostgreSQL DB
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment