Skip to content

Problem reading PostgreSQL data with RODBC

5 messages · Robert W. Burn, stephen sefick, Phil Spector +2 more

#
Are you using RPostgreSql package?  I use this quite effectivly to  
interact with my database.
HTH

Stephen
On Jan 23, 2011, at 10:48 AM, Robert W. Burn wrote:

            
#
Robert -
   If sqlTables() works, then R already knows the name of your database.
Do you get a different result if you try
- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Sun, 23 Jan 2011, Robert W. Burn wrote:

            
#
I think this is a problem with quotes.
If you look good, you see:

seiz.df <- sqlFetch(chnl, 'source.MAIN') 
...  'source.main': table not found on channel

You asked "MAIN", but your db can't find "main".

If you use seiz.df <- sqlFetch(chnl, '\"source\".\"MAIN\"') , you problem
should be gone.

Bart
1 day later
#
Am 24.01.2011 14:08, schrieb Bart Joosen:
I think the deeper problem lies with upper/lower case in the table name 
- is it MAIN, Main or main? If a tablename in PostgreSQL has at least 
one upper case, PostgreSQL uses quotes, and therefore the solution 
proposed above applies...

HTH,
Albin