Hi, I have opened the source of getSymbols.R and indeed there is no escaping going on. I will modify the source and add escaping. I will then test and submit a patch.
/Sergey On Tue, Jan 24, 2012 at 11:02 PM, Sergey Pisarenko <[email protected]> wrote: > Hi fellow R programmers, > > I am using quantmod to retrieve historic price data for a range of > stocks. The issue is that the program fails at certain points because > apparently the values that are sent to MySQL are not escaped properly > when quantmod executes sql queries. For example, following stocks will > cause issues: "ABV.C" (because of dot MySQL will think we are trying > to access table C), "ALL" (MySQL thinks this is a reserved sequence). > > Here's the code I have: > > # code omitted > .. > tickers <- dbListTables(con) # con is connection to MySQL db where > tables with stock data exist > > for (ticker in tickers) { > bars <- getSymbols(ticker, src="MySQL", auto.assign=FALSE) # it > fails here when data contains special characters > } > > Is this expected behavior and is there something I can do about it? > > I have tried using "try" and "tryCatch" but the execution breaks anyway. > > /Sergey _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
