Search code examples
rbloombergrmysql

Writing financial data to database using Rblpapi and RMySQL


I used Rblpapi to retrieve historic data, format is a list of data.frames. I now want to write that list of data into a MySQL database, I tried

dbWriteTable(con,name="db_all",data,header=T), which gives me

"unable to find an inherited method for function ‘dbWriteTable’ for signature ‘"MySQLConnection", "character", "list"’"

I have the feeling the problem is the list of data.frames, is there any easy way to insert this data from R into MySQL?


Solution

  • Did you try:

    df <- do.call("rbind", data)
    dbWriteTable(con, name="db_all", df, header=T)