Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 martyn_birzys
		
			martyn_birzys
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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;
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 arulsettu
		
			arulsettu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 
					
				
		
 arulsettu
		
			arulsettu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if NoOfRows('StockLevels') > 0 then
trace rows>0;
store ...........;
endif;
 Gabriel
		
			Gabriel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
 rajeshvaswani77
		
			rajeshvaswani77
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please try
if NoOfRows('StockLevels') > 0 then
Store StockLevels into ..\QVD\StockLevels.qvd;
end if
thanks,
Rajesh Vaswani
