MySQL Cursor


I’m trying to loop through exsisting SQL tables to retrieve the balance at a certain report date.

query_data = "SELECT `date`, `balance` FROM $table_name"

    # Execute the query
    data = DBInterface.execute(conn, query_data)

so data is now a MySQL text cursor. It seems to work up to a point because it has 2 fields (date and balance) and the correct number of rows.

As a next step I’d do a pivot wit dates as index and sum balance as values.

But if I do the below I get a dataframe full of missing values

trial = DataFrame(data)

If I do

    current_balances = []

# Iterate through rows and extract 'Current Balance' values
for nrows in data
    push!(current_balances, nrows[1])

I get only the dates column.

How can I get the cursor to dataframe in order to complete my analysis?