[R] RODBC and schemas

Duncan Golicher dgolicher at gmail.com
Mon May 5 22:50:36 CEST 2008


Many thanks Albin,

Problem solved. This works fine for me now.

library(RODBC)
con<-odbcConnect("mydb")
odbcQuery(con,"SET search_path =meso, pg_catalog;")
d<-sqlFetch(con,"trees")
sqlSave(d,"trees2")

Duncan

Albin Blaschka wrote:
> Duncan Golicher writes:
>
> [snip]
>> thread that I found led to an obvious solution. Brian Ripley pointed 
>> out the issue with the dot syntax and suggested that "you can set the 
>> schema and then use unqualified names." Does anyone know how this can 
>> be done for postgresql?
> [snip]
>
> The SQL-Syntax for this is:
> SET search_path = schemaname, anotherschema, pg_catalog;
>
> So, you have to pass this to postgres beforehand...
> Remark: pg_catalog is necessary, it is needed for general, built-in 
> functions of postgres
>
> Hope that helps,
>
> Greetings, Albin
>
>


-- 
Dr Duncan Golicher
Conservación y Restauración de los bosques de Chiapas
Ecología y systemática terrestre
Conservación de la Biodiversidad
El Colegio de la Frontera Sur
Carretera Panamericana y Periférico Sur s/n
29290 San Cristóbal de las Casas, Chiapas
967 67 49000 ext 1310

Email:  dgoliche at ecosur.mx
Skype: duncangolicher
WebLog http://duncanjg.wordpress.com/

Using Thunderbird on Ubuntu Hardy 8.04



More information about the R-help mailing list