Skip to content

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

Open
timmarch wants to merge 1 commit intojoshuaulrich:masterfrom
timmarch:master
Open

Updated getSymbols.MySQL SELECT statement to include dbname variable …#88
timmarch wants to merge 1 commit intojoshuaulrich:masterfrom
timmarch:master

Conversation

@timmarch
Copy link
Copy Markdown

@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.
Comment thread R/getSymbols.R
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
Copy Markdown
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