Skip to content

RODBC Error: 'getCharCE' must be called on a CHARSXP

4 messages · Mike Pfeiff, Uwe Ligges

#
On 20.12.2011 14:55, Mike Pfeiff wrote:
sqlQuery(channel, txt, errors=TRUE)

seems more plausible (since cat returns NULL).

Uwe Ligges
#
Thanks.   But if I do as you suggested...

	txt<-'SELECT Date,  Region, Price FROM TableXYZ WHERE Type="Domestic"'

returns...

	"SELECT TradeDate, Hub, SettlementPrice FROM PowerSettlements WHERE Contract=\"ERN\""

Which because of the extra "\"' is improper SQL form.

Maybe I should be asking what is the proper way to return "" inside of a char string?

-----Original Message-----
From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de] 
Sent: Tuesday, December 20, 2011 8:46 AM
To: Mike Pfeiff
Cc: 'r-help at r-project.org'
Subject: Re: [R] RODBC Error: 'getCharCE' must be called on a CHARSXP
On 20.12.2011 14:55, Mike Pfeiff wrote:
sqlQuery(channel, txt, errors=TRUE)

seems more plausible (since cat returns NULL).

Uwe Ligges
#
On 20.12.2011 16:27, Mike Pfeiff wrote:
That *is* the proper way: R jsut prints a " by \" in order to show tha 
those double quotes are within a string that is enclosed in double 
quotes. It is correctly passed to the SQL interface.

Uwe ligges