[R-sig-DB] Failure to give due credit whilst blaming others for your own mistakes (was Problems with sqlSave)
Prof Brian Ripley
r|p|ey @end|ng |rom @t@t@@ox@@c@uk
Wed Nov 12 10:08:59 CET 2008
On Tue, 11 Nov 2008, Grey Moran wrote:
> 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":
>
>> channel <- odbcConnect("MktRisk")
>> createTable.q <- "CREATE TABLE dbo.Arrests (State CHAR(20) NOT NULL, MURDER DECIMAL(6,3) NOT NULL, ASSAULT INTEGER NOT NULL, URBANPOP INTEGER NOT NULL, RAPE DECIMAL(6,3));"
>> sqlQuery(channel, createTable.q);
> character(0)
>> sqlTables(channel)
> TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
> .................
> 19 MktRisk dbo sysusers SYSTEM TABLE <NA>
> 20 MktRisk dbo Arrests TABLE <NA>
> ..................
>
>> sqlSave(channel, dat=USArrests, tablename=Arrests, rownames = "state", addPK=TRUE)
> Error in sqlSave(channel, dat = USArrests, tablename = Arrests,
> rownames = "state", : object "Arrests" not found
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.
--
Brian D. Ripley, ripley using stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-sig-DB
mailing list