Skip to content

Problems with sqlSave

3 messages · Grey Moran, Sean Davis, Brian Ripley

#
Hello,
I am trying to load data into SQL Server as follows (example
simplified for discussion purposes). The returned error complains of a
non existent table, which I can nevertheless "see":
character(0)
TABLE_CAT TABLE_SCHEM             TABLE_NAME   TABLE_TYPE REMARKS
.................
19   MktRisk         dbo               sysusers SYSTEM TABLE    <NA>
20   MktRisk         dbo                Arrests        TABLE    <NA>
..................
Error in sqlSave(channel, dat = USArrests, tablename = Arrests,
rownames = "state",  :   object "Arrests" not found

in the real case (more complex and hard to show here), I get this error:
Error in sqlSave(channel, dat = the.bridge.df, tablename = someTable,
:   unable to append to table 'US15Aug2008BridgeTable'

As far as I can tell, the tables I create are of the appropriate kind
- any ideas what might be the problem?

Thank you,

Grey
#
On Tue, Nov 11, 2008 at 6:06 PM, Grey Moran <grey.moran at gmail.com> wrote:

            
You need quotes around "Arrests", I think.

Sean

  
  
#
On Tue, 11 Nov 2008, Grey Moran wrote:

            
That's a simple and basic user error.  From the help

tablename: character: a database table name accessible from the
           connected dsn.  If missing, the name of 'dat'.

The error message says that there is no variable Arrests, and presumably 
"Arrests" was meant.  That is not taking into account that schema seem to 
be in use and no schema was selected.  (I don't use 'SQL Server', but 
selecting the schema is necessary in some other DBMS.)

Note that 'Grey Moran' has given no credit whatsoever for the work of 
others he is using, not even mentioning the package name.  This is not the 
first offence, and we expect much better in any future help requests -- 
and studying the R posting guide is not optional.