Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi All,
The following code is from help about deleting records. But why do we use "If ScriptErrorCount = 0 then " clause, what's the meaning of it?
Let ThisExecTime = Now( );
QV_Table:
SQL SELECT PrimaryKey, X, Y FROM DB_TABLE
WHERE ModificationTime >= #$(LastExecTime)#
AND ModificationTime < #$(ThisExecTime)#;
Concatenate LOAD PrimaryKey, X, Y FROM File.QVD
WHERE NOT EXISTS(PrimaryKey);
Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;
If ScriptErrorCount = 0 then
STORE QV_Table INTO File.QVD;
Let LastExecTime = ThisExecTime;
End If
 
					
				
		
 Oleg_Troyansky
		
			Oleg_Troyansky
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The meaning is that all the SQL and LOAD statements above were successfully executed with no errors. You don't want to override a "good" QVD file with potentially "Bad" data if something went wrong.
 
					
				
		
 Oleg_Troyansky
		
			Oleg_Troyansky
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The meaning is that all the SQL and LOAD statements above were successfully executed with no errors. You don't want to override a "good" QVD file with potentially "Bad" data if something went wrong.
 
					
				
		
Hi,
Thanks for your reply, does it mean we should always use this clause before overriding the QVD?
Isaac Li
 
					
				
		
 Oleg_Troyansky
		
			Oleg_Troyansky
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I'm not sure if everyone is always using it, but it does look like a good practice, especially if SQL or ODBC errors are frequent.
 
					
				
		
Hi,
During the execution of script the number of statements caused error will be retured by this statement. You are able to find this when you will open your Qv log file.
Regards,
Ravi
