Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have one table Tab1 and it contains A,B,C,D fields and it will refresh every 12 hours.Here we are doing full load for every 12 hours (not incremental load ).
My req is first time Tab1 contains 10 records then i stored it in Qvd. After refreshing the Tab1 there is no records (deleted) now i have to keep the old data(10 Records)
in QVD instead of storing 0 records. Means we have to store the data only when Tab1 contains more than one records, if record count is zero then we have to keep the previous QVD.
Is there any way to do this? If yes Could you please provide with sample.
Thanks,
Chiru
Try to load your table incrementally or otherwise you can check the no of rows of the table if it is greater than 0 then create the QVD otherwise do not create the QVD, For more see the example for that.
Tab1:
LOAD
Name,
Age
FROM TableName;
LET vNoRows = NoOfRows('Tab1'); //For finding the no of rows and store into the variable to check rows
if vNoRows > 0 then
STORE Tab1 into Tab1.qvd(qvd);
END IF
If understand the requirement correctly..
If any records are added/modified in database then only you have to update/add records to the QVD. This can be achieved using Incremental Load concept.
For more clarification, See the topic 'Using QVD Files for Incremental Load' in QliView help.
vLastExecutionTime=ReloadTime()
vCurrentExecStart=now()
Regards,
Pradeep
Sales:
Load * Inline
[
A, B, C, D
100,101,102,103
];
LET vNoOfRows = NoOfRows('Sales');
If $(vNoOfRows) > 0 then
Store Sales into Sales.qvd (QVD);
DROP Table Sales;
ELSE
SalesOld:
LOAD Customer, Sales
FROM
Sales.qvd
(qvd);
Store SalesOld into Sales.qvd (QVD);
DROP Table SalesOld;
END IF
Yourtablename:
LOAD
Name,
Age
FROM TableName;
LET vNoRows = NoOfRows('Yourtablename');
if '$(vNoRows)' > 0 then
STORE Yourtablename into Yourtablename.qvd(qvd);
END IF
Let me explain this with an example i have table where data for SaleReps and its age
Table1:
LOAD * Inline
[
Name, Age
A, 34
B, 43
C, 35
D, 56
E, 45
F, 45
G, 56
H, 35
I, 66
J, 77
];
LET vNoRows = NoOfRows('Table1');
if $(vNoRows) > 0 then
STORE Table1 into Table1.qvd(qvd);
END IF
Sales_Rep_Table: //This table updated every time when the table rows more than 0 rows only
LOAD
Name,
Age
FROM
Table1.qvd (qvd);