I am calling the MySQL stored procedure, which should return about 6,000 rows. But it only returns the last row. Looking at this, I canβt understand why it will return only the last line of information.
C # code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MySql.Data.MySqlClient; using System.Net; using FileHelpers; using Stockton; using System.IO; namespace MassHistoricalDownload { class Program { MySqlConnection conn = new MySqlConnection(); Reference r = new Reference(); static void Main(string[] args) { Program p = new Program(); p.DownloadHistoricData(); } public void DownloadHistoricData() { conn.ConnectionString = r.getMysqlConnection(); string historicalDataPath = r.getHistFileLocation(); string historicalDataExtension = ".csv";
MySQL stored procedure
CREATE DEFINER=`meggleston`@`%` PROCEDURE `pullHistSymbolAndDate`() BEGIN select c.symbol, hd.histDate from company c left join historical_data hd on hd.symbol = c.symbol and hd.histDate = (select max(histDate) from historical_data where symbol = c.symbol); END
source share