I have a huge sql database with 30 million rows, which consists of data for the past 2 months. I need to load this to qvd files and i need to create multiple qvd files according to the date, ie one file for data for a particular date.
So i used the following steps
1. Load entire data.
2. Take distinct date and store in a table
3. Run a for loop for the date and store in seperate qvd files
But my code crashes after the first iteration of the loop and the qvd fine is not created.
My code is:
LET vFilename = 'D:\a_Work\Datafiles\QVDtest\funnel_' & date(today(),'YYYY_MM_DD') & '.qvd';
SQL SELECT *
STORE TableTodaysData into $(vFilename);
LET vload = 'D:\a_Work\Datafiles\QVDtest\funnel_*' & '.qvd';
LOAD Distinct cdate as Tablenames
Let vTablecount = NoOfRows('Tables');
LET vsplitFilename = 'D:\a_Work\Datafiles\QVDtest\split\funnelsplit_';
For i=0 To $(vTablecount)-1
Let vTablename = Peek('Tablenames',$(i),'Tables');
Load * FROM $(vload)(qvd) Where cdate='$(vTablename)';
STORE Dummy into $(vsplitFilename)$(vTablename).QVD;