[Rd] RODBC problems with unixodbc

Vladimir Dergachev vdergachev at rcgardis.com
Tue Feb 20 20:07:55 CET 2007


On Tuesday 20 February 2007 1:51 pm, Sebastian P. Luque wrote:
> Hi,
>
> I noticed that if a column is named "end" in a data frame (table.df
> below), it leads to errors when trying to sqlSave()'it to a postgresql
> connection:
>
>
> ---<---------------cut here---------------start-------------->---
> con <- odbcConnect("PostgreSQL-DB", uid="user", pwd="password",
>                    case="postgresql")
> R> sqlSave(con, table.df)
> Error in sqlSave(con, table.df) :
> 	[RODBC] ERROR: Could not SQLExecDirect
> 42601 7 [unixODBC]Error while executing the query;
> ERROR:  syntax error at or near "end" at character 140
> ---<---------------cut here---------------end---------------->---
>
>
> If I rename the column to something else (e.g. "ending"), this proceeds
> without problems.  What could the problem be here?  Thanks.

It is likely "end" is a reserved word

                     best

                         Vladimir Dergachev

>
>
> Cheers,



More information about the R-devel mailing list