Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading data into table, but I only want to store data into qvd (overwrite existing qvd) if the the table contains data. If the table contains no data, I want to keep the existing qvd. I am getting an error on if statement:
//load new data
StockLevels:
LOAD "ITEMS";
SQL SELECT
"ITEMS"
FROM "PRODUCTS";
//check
if Count(Peek(ITEMS)) = 0 then
Store StockLevels into ..\QVD\StockLevels.qvd;
end if
Drop Tables StockLevels;
Hi,
As i understand you want to store the data into qvd if there is data into the SQL tables otherwise do not store the QVD. Then check for no of rows in the table like
//load new data
StockLevels:
LOAD "ITEMS";
SQL SELECT
"ITEMS"
FROM "PRODUCTS";
LET vNoofRows = NoOfRows('StockLevels');
//check
if $(vNoofRows) > 0 then
Store StockLevels into ..\QVD\StockLevels.qvd;
end if
Drop Tables StockLevels;
Regards
Anand
Hi,
As i understand you want to store the data into qvd if there is data into the SQL tables otherwise do not store the QVD. Then check for no of rows in the table like
//load new data
StockLevels:
LOAD "ITEMS";
SQL SELECT
"ITEMS"
FROM "PRODUCTS";
LET vNoofRows = NoOfRows('StockLevels');
//check
if $(vNoofRows) > 0 then
Store StockLevels into ..\QVD\StockLevels.qvd;
end if
Drop Tables StockLevels;
Regards
Anand
if NoOfRows('StockLevels') > 0 then
trace rows>0;
store ...........;
endif;
Hi,
If I understand you. You want to store data coming from SQL into a table in QVD file if a particular table has data?
What might be worth trying is using QvdTableName.
So
IF(QvdTableName('D:\Dir\FileName.qvd')) <> 0 THEN
STORE blah blah
ELSE
exit blah blah
ENDIF
Give that a try.
Please try
if NoOfRows('StockLevels') > 0 then
Store StockLevels into ..\QVD\StockLevels.qvd;
end if
thanks,
Rajesh Vaswani