Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated getSymbols.MySQL SELECT statement to include dbname variable … #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timmarch
Copy link

@timmarch timmarch commented Jun 1, 2016

…when specifying table. Resolves issue with tables named after MySQL operators (eg. ADD). Triggered by an issue working with Australian Stock Exchange data that contains the ADD symbol.

EDIT 2016-07-19: This pull contains two changes-

  1. Added 'from' and 'to' options to getSymbols.MySQL for subsetting by date in database call.
  2. Added backticks to getSymbols.MySQL SELECT statement, fixes error retrieving symbols with same name as SQL operators.

Branch commit history has been squashed/rebased for merge.

…ate in database call. Added backticks to getSymbols.MySQL SELECT statement, fixes error retrieving symbols with same name as SQL operators.
@@ -631,7 +631,13 @@ function(Symbols,env,return.class='xts',
if(verbose) {
cat(paste('Loading ',Symbols[[i]],paste(rep('.',10-nchar(Symbols[[i]])),collapse=''),sep=''))
}
query <- paste("SELECT ",paste(db.fields,collapse=',')," FROM ",Symbols[[i]]," ORDER BY date")
Copy link
Owner

@joshuaulrich joshuaulrich Jul 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the backticks would have been cleaner as:

query <- paste("SELECT ",paste(db.fields,collapse=',')," FROM `",Symbols[[i]],"` ORDER BY date",sep="")

It would also be good to separate this change from the change that adds the from and to arguments by putting them in different commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants