[R] sqlSave with underscores in table fieldname

About this list Date view Thread view Subject view Author view Attachment view

From: Hoeven, Maarten van der (Maarten.van.der.Hoeven@knmi.nl)
Date: Mon 10 May 2004 - 20:34:20 EST


Message-id: <1F8990C21AC73945BE6AAC5AD6D4CAE934CC7C@BCSXAC.knmi.nl>

Hi group,

I try to write a frame to a table (RODBC). I use
        colnames(temp6) <- c("ind_id","ser_id","period_id","year","calc","mean")
        sqlSave(channel, temp6, tablename = "series_indices_test",append= TRUE, rownames=FALSE, verbose = FALSE, test = FALSE, nastring = -999999, fast = FALSE)

This is giving me an error:
        Error in sqlSave(channel, temp6, tablename = "series_indices_test", append = TRUE, :
                unable to append to table %sseries_indices_test

My table definition is:
ind_id smallint(3)
ser_id smallint(4)
period_id tinyint(2)
year smallint(4)
calc mediumint(6)
mean mediumint(6)

This error is related to the underscores I use in the table. Because, when I change the table definition to (removing underscores):

indid smallint(3)
serid smallint(4)
periodid tinyint(2)
year smallint(4)
calc mediumint(6)
mean mediumint(6)

and execute
        colnames(temp6) <- c("indid","serid","periodid","year","calc","mean")
        sqlSave(channel, temp6, tablename = "series_indices_test",append= TRUE, rownames=FALSE, verbose = FALSE, test = FALSE, nastring = -999999, fast = FALSE)

it goes well.

Not using the underscores is not really prefered, as this table with this underscores in the definition is used on a lot of places elsewhere. But if removing the underscores is the only solution, let me know as well.

Any clue?

Using R 1.9.0, RODBC-package 1.4.0 (underlying database MySQL 4.0.16-standard)

Thanks,
Maarten

+-------------------------------
| Maarten van der Hoeven
| KNMI, De Bilt
| +31-30-2206 402
| maarten.van.der.hoeven@knmi.nl
+-------------------------------
--------------------------------------------------------------

Zie ook/see also: http://www.knmi.nl/maildisclaimer.html

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:08 EST