Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
One of our environment has some problems with storing qvd files. 99.9% time STORE tablename INTO filename.qdv (qvd) works ok, but sometimes we get general script error and script just quits.
I tried to put this kind of test/ looping and store table until it is succeeded, In Windows file explorer I put the Transactions.qvd file to "Read only" state,
just for simulating Storing problem. Becaus it is very hard to get a real storing problem with this kind of small sandbox testes.
What should be fixed in the next part of the script?
Thank you very much!
BR, Harri
////////////////////////
SET ErrorMode= 0;
STORE Transactions INTO Transactions.qvd (qvd); // First attempt And here script also ends, even with ErrorMode set to 0;
// If everthing went fine, the following will only iterate 5 taking very few time
FOR vAttemptNo = 1 TO 5 // Number of attempts
IF ScriptError = 1 THEN
SLEEP 10000; // 10 secs
EXIT SCRIPT WHEN $(vAttemptNo) => 5; //exit out if storing has not succeeded after 1+4 times of trying
STORE Transactions INTO Transactions .qvd (qvd); // another attempt
ENDIF
NEXT
////////////////////////////
just a quick one, just from looking at this, you ALWAYS want to set error mode back to 1 after your done with it, or the script will always run
There appear to be some limitations with the ErrorMode=0 exception handling, in that, well... it doesn't handle exceptions!
Please see this idea - I have provided steps to reproduce with a locked file.
http://community.qlik.com/ideas/3443
Here is the description of the ErrorMode handling in from the manual, page 292:
This variable determines what action is to be taken by QlikView when an error is encountered during script
(non-batch mode). By setting ErrorMode =0 QlikView will simply ignore the failure and continue script
execution at the next script statement. By setting ErrorMode =2 QlikView will trigger an "Execution of
script failed..." error message immediately on failure, without prompting the user for action beforehand.
Clearly a bug to me, but according to QT support it is not, and an "idea" has to be created to get it fixed.
Please vote for it...
http://community.qlik.com/ideas/3443
Thanks