[R] RODBC problem

Vladimir Eremeev wl2776 at gmail.com
Wed Sep 26 13:29:27 CEST 2007


You can trace this function:

install.packages("debug")
library(debug)
mtrace(sqlFetch)
sqlFetch(channel,"t_studie")

Then you'll have the new window showing function code and allowing you to
execute it step by step, view intermediate results, variables, etc.

To switch off tracing, use
mtrace(sqlFetch,FALSE)
or
mtrace.off() # this switches off all tracees.

Very useful tool. I used it a lot while was struggling with the reshape().


Bernhard2 wrote:
> 
> Hello,
> 
> as I wrote I call
> 
>   sqlFetch(channel,"t_studie")
> 
> and this function generates in the background the concrete query. How can
> I view/log/... the concrete query?
> 
> Regards,
> 
> Bernhard 
> 
>> -----Original Message-----
>> From: DUPREZ Cédric [mailto:cedric.duprez at ifn.fr] 
>> Sent: Friday, July 06, 2007 11:59 AM
>> To: Bernhard Wellhöfer
>> Cc: r-help at stat.math.ethz.ch
>> Subject: RE: [R] RODBC problem
>> 
>> Hello,
>> 
>> The problem seems to be in the query syntax.
>> Can you show us the query you are trying to perform ?
>> 
>> Regards,
>> 
>> Cedric
>> 
>> -----Message d'origine-----
>> De : r-help-bounces at stat.math.ethz.ch 
>> [mailto:r-help-bounces at stat.math.ethz.ch] De la part de 
>> Bernhard Wellhöfer
>> Envoyé : vendredi 6 juillet 2007 11:45
>> À : r-help at stat.math.ethz.ch
>> Objet : [R] RODBC problem
>> 
>> Hello,
>>  
>> I use a RODBC connection to a MySQL server on a Debian 
>> machine. The call to odbcConnect() seems to be ok, but the 
>> result of the first sqlFetch(channel,"t_studie") retrieves 
>> this data frame:
>>  
>> [1] "[RODBC] ERROR: Could not SQLExecDirect"
>> [2] "42000 1064 [MySQL][ODBC 3.51 
>> Driver][mysqld-5.0.22-Debian_1bpo1-log]You have an error in 
>> your SQL syntax; check the manual that corresponds to your 
>> MySQL server version for the right syntax to use near '\"t_studi(\004"
>> 
>> Please note the funny character at the end of the table name 
>> in the error message.
>>  
>> The "Test Data Source" option on the ODBC Data Source Name 
>> configuration panel report success.
>>  
>> Who can help me here?
>>  
>> Regards,
>>  
>> Bernhard
> 

-- 
View this message in context: http://www.nabble.com/RODBC-problem-tf4034563.html#a12898875
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list