[R] rjdbc identifier.quote

Gabor Grothendieck ggrothendieck at gmail.com
Thu Feb 10 04:50:28 CET 2011


On Wed, Feb 9, 2011 at 9:06 PM, Armand Pirvu (gmail)
<armand.pirvu at gmail.com> wrote:
> Dear all
>
>
> Backend is Ingres DBMS
> I use RJDBC with Ingres JDBC driver
>
> I have this csv file
>
> "","Strategy","par1","m.1997.09.01"
> "1","ALF",2,0.1244
>
>
> which I try to load it RJDBC
>
>
> require (RJDBC)
> drv <- JDBC("com.ingres.jdbc.IngresDriver","/home/ingres/ingresv1/ingres/lib/iijdbc.jar")
> conn <- dbConnect(drv, "jdbc:ingres://192.168.5.21:V17/rtestdb")
> mylargedata <- read.csv(file="a5.csv.v0",head=TRUE,sep=",")
>> dbWriteTable(conn, "table5",mylargedata)
> Error in .sql.qescape(names(value), TRUE, conn at identifier.quote) :
>  The JDBC connection doesn't support quoted identifiers, but table/column name contains characters that must be quoted (m.1997.09.01)
>
>
> So I did another test. I used  Squirel SQL client (JAVA based) and I ran this
>
> create table foo ("m.col1" integer)
>
>
> And it succeeded
>
> I checked in the database
>
> * help table foo \g
> Name:                 foo
> Column Information:
>                                                                  Key
> Column Name                      Type       Length Nulls Defaults Seq
> "m.col1"                         integer         4  yes    null
>
>
>
> At this point I am not sure, whether the issue is in Ingres JDBC driver or in RJDBC ? Or maybe is it a specific value for identifier.quote ?
>
>
> Any help is appreciated

In both the RpgSQL and RH2 drivers (which each call RJDBC for the
respective databases) I had found that this worked:

JDBC(..., identifier.quote = "\"")

where above we have double quote, backslash, double quote, double quote.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list