Skip to content

RODBC sqlSave problem.

2 messages · Fredrik Karlsson, Brian Ripley

#
Dear list,

Being new to both the postgres database, ODBC and the RODBC interface, I
am somewhat confused by some of the problems I am experiencing trying to
connect R to the database.

Whai I am trying is basically the example part of the help file for the 
sqlSave function:
Query: CREATE TABLE USArrests  (rownames varchar(255)  ,Murder float8
,Assault int4  ,UrbanPop int4  ,Rape float8  )
Error in sqlSave(channel, USArrests, verbose = TRUE) : 
        [RODBC] ERROR: Could not SQLExecute

When issuing this comamnd, a table is created in the specified database,
with fields corresponding to names(USArrests), except in lower case, but 
the fiels contain no data. 

Does anyone know the reason for this? One of my guesses is that the
table and field names are converted into lower cases by the database
manager, which would result in an error due to  non-existent symbols
when RODBC tries to inser the data.
Is this a possibility? Does anyone know how to investigate this?

Are there alternative explanations?

I would, of course, be extremely greateful for all the help I can get.



/Fredrik Karlsson
#
On Wed, 2 Apr 2003, Fredrik Karlsson wrote:

            
You would be: there is an extensive set of help pages, and you have not
looked up odbcConnect!
Read the help page!  odbcConnect has a `case' argument. There is even a
file tests.R with PostgreSQL examples in the distribution.
I would be grateful if you would read the help pages before posting to
R-help.